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

20 Inheritance

When you created the BNRPerson class, you declared it to be a subclass of NSObject. This means that every instance of BNRPerson will have the instance variables and methods defined in NSObject as well as the instance variables and methods defined in BNRPerson. We say that BNRPerson inherits the instance variables and methods from NSObject.

In this chapter, you are going to create a new class named BNREmployee. BNREmployee will be a subclass of BNRPerson.

Figure 20.1  BNREmployee inherits from BNRPerson

BNREmployee inherits from BNRPerson

Makes sense, right? Employees are people. They have heights and weights. But not all people are ...

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