Why are instance variables considered bad practice by Apple?

Viewed 3120

In Apple's Programming with Objective-C the section on Encapsulating Data states that:

You Can Define Instance Variables without Properties

It’s best practice to use a property on an object any time you need to keep track of a value or another object.

In other words they are strongly recommending that you use private properties rather than instance variables for any private object state.

I am wondering why this might be the case? I understand that properties have features such as KVO, and attributes (strong, weak ...), but in many cases I do not need these features and an instance variable will work just fine.

Are there any good reasons why instance variables might not be considered best practice?

3 Answers
Related