June 2011
Intermediate to advanced
590 pages
19h 31m
English
Classes exist in a hierarchy, and every class has exactly one superclass – except for the root class of the entire hierarchy: NSObject (Figure 2.8). A class inherits the behavior of its superclass, which means, at minimum, every class inherits the methods and instance variables defined in NSObject. As the top superclass, NSObject’s role is to implement the basic behavior of every object in Cocoa Touch. Two of the methods NSObject implements are alloc and description. (We sometimes say “description is a method on NSObject” and mean the same thing.)
Figure 2.8 Class hierarchy

A subclass can add methods and instance ...
Read now
Unlock full access