ios - 在.m文件的interrface中的变量声明和方法声明区别?
ringa_lee
ringa_lee 2017-04-17 16:46:33
0
2
568

通过拖线的方式,将控件属性放到.m文件的@interface中的变量声明方法声明中有什么不同呢,为什么放到变量申明的时候不能通过self.去访问?如图中3位置中只能访问2位置而不能访问1位置中的声明。

ringa_lee
ringa_lee

ringa_lee

reply all(2)
PHPzhong

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.

小葫芦
@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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template