Search code examples
objective-ciospropertiesivar

Is it necessary, or even good practice, to create properties for all iVars?


If an ivar is to be used globally within the class, but will never be accessed by other classes, are we still supposed to use properties?


Solution

  • It is generally a good idea, as the generated accessors will take care of things like memory management and KVO for you. You can put the property in a class extension so other classes can't use it.