84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
为什么同时重新 getter 和 setter 方法时,访问不了_属性?怎么才能同时重写 getter 和 setter 方法,小白求教!
This will indeed prompt an error, you need to add a line:
@synthesize city = _city;
After encapsulation, attributes can only be accessed through the encapsulation method. Change _city to self.city. I don’t know if that’s right
This will indeed prompt an error, you need to add a line:
After encapsulation, attributes can only be accessed through the encapsulation method. Change _city to self.city. I don’t know if that’s right