0Pricing
Objective-C iOS Development for Legacy & Enterprise Apps · Lesson

Inheritance and Method Overriding

Build class hierarchies in Objective-C with subclassing, override inherited methods, and call up to the superclass using super.

What is Inheritance?

Inheritance lets a class reuse and extend another class. The new subclass gets all the methods and properties of its superclass, then adds or changes behavior.

Declaring a Subclass

The colon syntax in the interface declares the superclass. Here Dog inherits from Animal.

@interface Dog : Animal
- (void)fetch;
@end

All lessons in this course

  1. Classes, Objects, and Methods
  2. Properties and Instance Variables
  3. Protocols and Categories
  4. Inheritance and Method Overriding
← Back to Objective-C iOS Development for Legacy & Enterprise Apps