Objective-C Lesson in Class Design
- by Pota Onasys
I have the following classes:
Teacher
Student
Class (like a school class)
They all extend from KObject that has the following code:
- initWithKey
- send
- processKey
Teacher, Student Class all use the functions processKey and initWithKey from KObject parent class. They implement their own version of send. The problem I have is that KObject should not be instantiated ever. It is more like an abstract class, but there is no abstract class concept in objective-c. It is only useful for allowing subclasses to have access to one property and two functions.
What can I do so that KObject cannot be instantiated but still allow subclasses to have access to the functions and properties of KObject?