December 2015
Intermediate to advanced
400 pages
13h 3m
English
In Chapter 15, you learned about class inheritance. Any function that expects an argument of a class can also accept arguments that are subclasses of that class. This ability to accept either a class or any subclass of it is often referred to as polymorphism, but is more accurately known as runtime polymorphism or subclass polymorphism. Polymorphism, meaning “many forms,” means you have written a single function that can accept different types.
Runtime polymorphism is a very powerful tool, and the frameworks Apple provides for iOS and Mac OS X development use it very frequently. Unfortunately, it has drawbacks. Classes that are related by inheritance are tied together tightly: it can be ...
Read now
Unlock full access