7. Working with Object-Oriented Inheritance

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

Get Objective-C: Visual QuickStart 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.