当前位置:网站首页>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;
}
边栏推荐
- @Scheduled scheduled tasks
- Zlmediakit compilation and webrtc push-pull flow testing
- Hospital network planning and design document based on GLBP protocol + application form + task statement + opening report + interim examination + literature review + PPT + weekly progress + network to
- Aperçu du code source futur - série juc
- New year's first race, submit bug reward more!
- Unity knapsack system (code to center and exchange items)
- Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress
- Rhcsa day 2
- Session learning diary 1
- Site favorites
猜你喜欢

I stepped on a foundation pit today

How to use websocket to realize simple chat function in C #
![Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]](/img/0d/7a8370d153a8479b706377c3487220.jpg)
Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]

7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages

Webhook triggers Jenkins for sonar detection

Unity controls the selection of the previous and next characters

Development of digital collection trading platform development of digital collection platform

Dare to climb here, you're not far from prison, reptile reverse actual combat case

Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram

Add IDM to Google browser
随机推荐
warning: LF will be replaced by CRLF in XXXXXX
No clue about the data analysis report? After reading this introduction of smartbi, you will understand!
Future源碼一觀-JUC系列
Code Execution Vulnerability - no alphanumeric rce create_ function()
Recent learning fragmentation (14)
Jenkins configures IP address access
Easy to win insert sort
GUI Graphical user interface programming (XIV) optionmenu - what do you want your girlfriend to wear on Valentine's day
static hostname; transient hostname; pretty hostname
Hospital network planning and design document based on GLBP protocol + application form + task statement + opening report + interim examination + literature review + PPT + weekly progress + network to
Base d'apprentissage de la machine: sélection de fonctionnalités avec lasso
Which product is better for 2022 annual gold insurance?
JVM family -- monitoring tools
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
[latex] production of complex tables: excel2latex and detail adjustment
Development of digital collection trading platform development of digital collection platform
Handler source code analysis
Day05 錶格
Want to do something in production? Then try these redis commands
Webhook triggers Jenkins for sonar detection