objective-c - @property重写 setter 和 getter 方法
过去多啦不再A梦
过去多啦不再A梦 2017-05-02 09:24:48
0
2
695

为什么同时重新 getter 和 setter 方法时,访问不了_属性?怎么才能同时重写 getter 和 setter 方法,小白求教!

过去多啦不再A梦
过去多啦不再A梦

reply all(2)
我想大声告诉你

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!