O'Reilly logo

Objective-C Programming: The Big Nerd Ranch Guide by Mikey Ward, Aaron Hillegass

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required