Inheritance hierarchy

All objects inherit (either directly or indirectly) from NSObject:

Figure 20.3  Inheritance diagram of some classes you know

Inheritance diagram of some classes you know

NSObject has many methods but only one instance variable: the isa pointer. Every object’s isa pointer points at the class that created it. (Get it? When you have a BNRPerson instance, that object is a BNRPerson. When you have an NSString instance, that object is a[n] NSString.)

Figure 20.4  Every object knows which class created it

Every object knows which class created it

When you send a message to an object, ...

Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.