Abstract Classes
What better way to conclude this chapter than with a bit of terminology? We introduce it here because it’s directly related to the notion of inheritance.
Sometimes, classes are created just to make it easier for someone to create a subclass. For that reason, these classes are called abstract classes or, equivalently, abstract superclasses. Methods and instance variables are defined in the class, but no one is expected to actually create an instance from that class. For example, consider the root object NSObject. Can you think of any use for defining an object from that class?
The Foundation framework, covered in Part II, “The Foundation Framework,” has several of these so-called abstract classes. As an example, the Foundation’s ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access