Why we have to synthesize?
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/
精彩评论