开发者

Property and synthesize in iOS [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

@property @synthesize

开发者_如何学JAVA

When must I use property and synthesize for an element as NSArray, NSSTring....or IBOutelt as UIButton or UITextFiled?


A property is used mainly when other objects need to change or access the ivars in your object. Without manually defining getters and setters, or using @property, other objects can't see or change the ivars. Properties are also often used for convenience of memory management, assisting you in preventing memory leaks.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜