开发者

Property and synthesize in iOS [duplicate]

开发者 https://www.devze.com 2023-02-26 19:26 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: @property @synthesize开发者_如何学JAVA
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

精彩评论

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