开发者

Why we have to synthesize?

开发者 https://www.devze.com 2023-02-09 18:00 出处:网络
Hi I\'m new t开发者_运维百科o i phone I want to know why we have to synthesize.You don\'t have to use @synthesize, but if you don\'t then you are responsible to write the setter and getter methods for

Hi I'm new t开发者_运维百科o i phone I want to know why we have to synthesize.


You don't have to use @synthesize, but if you don't then you are responsible to write the setter and getter methods for that property.


The @synthesize directive automatically generates the setters and getters for us,

Accessors will only be generated if they don't already exist, so feel free to specify @synthesize for a property, then implement your custom getter or setter if you want. The compiler will fill in whichever method is missing.

check this link: http://cocoadevcentral.com/d/learn_objectivec/

0

精彩评论

暂无评论...
验证码 换一张
取 消