OC-成员变量的作用域

#import <Foundation/Foundation.h>

@interface Person : NSObject
{
    int _no;
    
    @public // 在任何地方都能直接访问对象的成员变量
    int _age;
    
    
    @private  // 只能在当前类的对象方法中直接访问
    int _height;
    
    @protected // 能在当前类和子类的对象方法中直接访问、、默认是protect
    int _weight;
    int _money;
}

- (void)setHeight:(int)height;
- (int)height;

- (void)test;
@end
原文地址:https://www.cnblogs.com/IDRI/p/4952479.html