Property and synthesize in iOS

19,208

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.

Share:
19,208

Related videos on Youtube

cyclingIsBetter
Author by

cyclingIsBetter

Updated on June 04, 2022

Comments

  • cyclingIsBetter
    cyclingIsBetter almost 2 years

    Possible Duplicate:
    @property @synthesize

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

    • jscs
      jscs almost 13 years
      Duplicates: 1 2 3 4 5 ...
    • Zut
      Zut over 11 years
      @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 =)
  • Taiko
    Taiko over 9 years
    And @synthesize means the getters and setters are automatically generated.

Related