What are the differences between Instances and member variables in the context of objective-c. I have seen these two terms referred to but never clearly delineated. A google and stack overflow search yielded no immediate explanations so i thought I'd pose the question.
1 Answer
Member variable is a more generic term. In other languages, like C++ or Java, member variable can refer to either an instance variable or a class variable (static member variable).
Objective C does not have class variables, so instance variable and member variable are synonyms.
As a side note, in modern Objective C, instance variable (also called ivars in Objective C) should only be created from auto-synthesized properties (as noted by rfj001).
UPDATE
Instance variable only being created from auto-synthesized properties is an Apple recommended practice for modern Objective C.
Using properties instead of instance variables in as many places as possible provides many benefits
Programming with Objective-C: Encapsulating Data
It’s best practice to use a property on an object any time you need to keep track of a value or another object.
As with all rules of programming there may be times when you need to break this rule and directly declare an ivar. This however should be the rare exception and not the rule.