4

Possible Duplicate:
@property @synthesize

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

Community
  • 1
  • 1
cyclingIsBetter
  • 17,447
  • 50
  • 156
  • 241
  • 3
    Duplicates: [1](http://stackoverflow.com/questions/2032826/) [2](http://stackoverflow.com/questions/5140782/) [3](http://stackoverflow.com/questions/3169822/) [4](http://stackoverflow.com/questions/4700296/) [5](http://stackoverflow.com/questions/3394206/when-u-have-to-use-property-and-synthesize-in-iphone-sdk) [...](http://stackoverflow.com/search?page=2&tab=relevance&q=synthesize%20iphone) – jscs Apr 19 '11 at 16:30
  • 2
    @Mat "This site is not a substitute for the vast amounts of documentation on objective-c already available through search engines." Well, this is currently the first hit on google for "iOs synthesize", so you should post an answer instead of a comment, or you comment will contradict itself =) – Zut Jul 03 '12 at 11:38

1 Answers1

5

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.

voidzm
  • 649
  • 1
  • 4
  • 8