当前位置:网站首页>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;
}
边栏推荐
- Why is it recommended that technologists write blogs?
- 渗透实战-guest账户-mimikatz-向日葵-sql提权-离线解密
- 機器學習基礎:用 Lasso 做特征選擇
- Summary of Chinese remainder theorem
- 2022 registration examination for safety production management personnel of fireworks and firecracker production units and examination skills for safety production management personnel of fireworks an
- Add token validation in swagger
- Development of digital collection trading platform development of digital collection platform
- Contest3145 - the 37th game of 2021 freshman individual training match_ D: Ranking
- logistic regression
- Base d'apprentissage de la machine: sélection de fonctionnalités avec lasso
猜你喜欢
Practical multifunctional toolbox wechat applet source code / support traffic master
Lichuang EDA learning notes 14: PCB board canvas settings
MySQL query
Consul of distributed service registration discovery and unified configuration management
JVM family -- heap analysis
MySQL is dirty
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Package details_ Four access control characters_ Two details of protected
GUI Graphical user interface programming (XIV) optionmenu - what do you want your girlfriend to wear on Valentine's day
Summary of Chinese remainder theorem
随机推荐
How to use websocket to realize simple chat function in C #
Backpropagation formula derivation [Li Hongyi deep learning version]
Command Execution Vulnerability - command execution - vulnerability sites - code injection - vulnerability exploitation - joint execution - bypass (spaces, keyword filtering, variable bypass) - two ex
Third party login initial version
Typical applications of minimum spanning tree
Day05 錶格
Enhanced for loop
2006 translation
1day vulnerability pushback skills practice (3)
Keepalived set the master not to recapture the VIP after fault recovery (it is invalid to solve nopreempt)
Zigzag scan
Rhcsa day 3
Practical multifunctional toolbox wechat applet source code / support traffic master
Constantly changing harmonyos custom JS components during the Spring Festival - Smart Koi
super_ Subclass object memory structure_ Inheritance tree traceability
SQL injection (1) -- determine whether there are SQL injection vulnerabilities
Add token validation in swagger
The difference between MCU serial communication and parallel communication and the understanding of UART
The property of judging odd or even numbers about XOR.
(practice C language every day) pointer sorting problem