Property and synthesize in iOS

cyclingIsBetter picture cyclingIsBetter · Apr 19, 2011 · Viewed 19.2k times · Source

Possible Duplicate:
@property @synthesize

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

Answer

voidzm picture voidzm · Apr 19, 2011

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.