February 2010
Beginner
240 pages
3h 4m
English
This chapter discusses the process of deriving one class from another—a process called inheritance.
You can derive one class from another in Objective-C. The class you derive from is called the base class, and the new class you’re deriving from the base class is called the derived class.
The derived class can inherit all the functionality of the base class, and it can customize that functionality as well. For example, you might have a base class named Animal that creates a generic animal. The Animal class might have a method to set the animal’s name, setName, and another to get the animal’s name, getName. Then, no matter what kind of animal you want to create, Animal can serve as a base class for it, ...
Read now
Unlock full access