当前位置:网站首页>Objective-C member variable permissions
Objective-C member variable permissions
2022-07-04 03:34:00 【Zyryck】
Member variable permissions
Declaring member variables cannot declare properties and methods
@public Open It's OK not to pass setter/getter visit
@private Private have access to setter/getter visit , uninheritable
@protected The protected ( Default permissions ) Can be inherited , have access to setter/getter
@package Accessible within the framework , Not accessible outside the framework
#import <Foundation/Foundation.h>
@interface Person : NSObject{
@public
NSString* _name;
}
@end
#import <Foundation/Foundation.h>
#import "Person.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
Person* p1 = [Person new];
//public Access to member variables
p1->_name = @"dancer";
}
return 0;
}
边栏推荐
- Handler source code analysis
- Unity writes a character controller. The mouse controls the screen to shake and the mouse controls the shooting
- 2022 Guangxi provincial safety officer a certificate examination materials and Guangxi provincial safety officer a certificate simulation test questions
- 1day vulnerability pushback skills practice (3)
- 1day vulnerability pushback skills practice (3)
- XSS prevention
- Contest3145 - the 37th game of 2021 freshman individual training match_ J: Eat radish
- Learning video website
- Webhook triggers Jenkins for sonar detection
- Redis notes (I) Linux installation process of redis
猜你喜欢
@Scheduled scheduled tasks
Es network layer
Defensive programming skills
Zblog collection plug-in does not need authorization to stay away from the cracked version of zblog
Jenkins continuous integration environment construction V (Jenkins common construction triggers)
渗透实战-guest账户-mimikatz-向日葵-sql提权-离线解密
Tsinghua University product: penalty gradient norm improves generalization of deep learning model
WordPress collection WordPress hang up collection plug-in
150 ppt! The most complete "fair perception machine learning and data mining" tutorial, Dr. AIST Toshihiro kamishima, Japan
Redis notes (I) Linux installation process of redis
随机推荐
No clue about the data analysis report? After reading this introduction of smartbi, you will understand!
Why is it recommended that technologists write blogs?
1day vulnerability pushback skills practice (3)
Value transfer communication between components (parent to child, child to parent, brother component to value)
WP collection plug-in free WordPress collection hang up plug-in
[development team follows] API specification
Examination question bank of constructor decoration direction post skills (constructor) and examination data of constructor decoration direction post skills (constructor) in 2022
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
機器學習基礎:用 Lasso 做特征選擇
Zhihu million hot discussion: why can we only rely on job hopping for salary increase? Bosses would rather hire outsiders with a high salary than get a raise?
Dare to climb here, you're not far from prison, reptile reverse actual combat case
[PaddleSeg 源码阅读] PaddleSeg计算 mIoU
How to use STR function of C language
Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
Contest3145 - the 37th game of 2021 freshman individual training match_ 1: Origami
system information
The 37 year old programmer was laid off, and he didn't find a job for 120 days. He had no choice but to go to a small company. As a result, he was confused
Baijia forum the founding of the Eastern Han Dynasty
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
Site favorites