Edit AllPages

A DataMember, also InstanceVariable or ivar, is a data variable which is a part of AnObject.

It can be many things, from something as simple as an integer:

int oneDataMember;

Through more complex things like strings:

char* anotherDataMember;

Up to complex things like selectors:

SEL* aSelector;

And advanced things like objects:

id someObject; NSString * stringObject;

A DataMember is sometimes also referred to as an InstanceVariable (or “ivar” for short) because it is a variable that only exists within an instance of a class.