21 Object Instance Variables and Properties
Thus far, the instance variables of your objects have been mostly simple C types like int or float. It is far more common for instance variables to be pointers to other objects, like _hireDate. An object instance variable points to another object and describes a relationship between the two objects. Usually, object instance variables fall into one of three categories:
-
Object-type attributes: a pointer to a simple, value-like object like an NSString or an NSDate. For example, an employee’s last name would be stored in an NSString. Thus, an instance of BNREmployee would have an instance variable that would be a pointer to an instance of NSString. We recommend that you always declare ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access