通过拖线的方式,将控件属性放到.m文件的@interface中的变量声明和方法声明中有什么不同呢,为什么放到变量申明的时候不能通过self.去访问?如图中3位置中只能访问2位置而不能访问1位置中的声明。
PHPz2017-04-17 16:48:33
self. is calling the setter and getter methods. You only declared the variable at position 1 and did not write the setter and getter methods for the property.
高洛峰2017-04-17 16:48:33
@interface MyClass (Category)
-(Abc*) testFunc;
@end
Those with words in the brackets are declaring a Catetory for a class
@interface MyClass ()
-(Abc*) testExtension;
@end
The blank words in the brackets are extension, and inside are the private variables and methods of this class