84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
通过拖线的方式,将控件属性放到.m文件的@interface中的变量声明和方法声明中有什么不同呢,为什么放到变量申明的时候不能通过self.去访问?如图中3位置中只能访问2位置而不能访问1位置中的声明。
ringa_lee
self.是调用setter和getter方法,你只在位置1处做了变量声明,没有写该属性的setter和getter方法。
@interface MyClass (Category) -(Abc*) testFunc; @end
这种括号里有字的 就是给一个类声明了一个Catetory
@interface MyClass () -(Abc*) testExtension; @end
这种括号里没字的 是extension 里边都是这个类私有的变量和方法
self.是调用setter和getter方法,你只在位置1处做了变量声明,没有写该属性的setter和getter方法。
这种括号里有字的 就是给一个类声明了一个Catetory
这种括号里没字的 是extension 里边都是这个类私有的变量和方法