objective-c - @property overrides setter and getter methods
过去多啦不再A梦
过去多啦不再A梦 2017-05-02 09:24:48
0
2
764

Why can’t I access the _ attribute when I rewrite the getter and setter methods at the same time? How can I rewrite the getter and setter methods at the same time? Please help me!

过去多啦不再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