@private在Objective-C 中意味着什么?
我在一个类中声明了一个属性:
@property double x;
Run Code Online (Sandbox Code Playgroud)
然后我创建了该类的子类,我在其中声明了另外两个属性:
@property double a, b;
Run Code Online (Sandbox Code Playgroud)
然后我在子类中创建了一个init方法:
-(id)initWithAValue:andBValue:
Run Code Online (Sandbox Code Playgroud)
我被允许使用:
_a; // same for b
[self setValue a]; // same for b
self.a; // same for b and x
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试使用x属性时,我只能使用[self setValue x]而我不能使用_x.为什么?