I want to create a class hierarchy something like this:
AbstractBaseClass – > SubClass1, AbstractBaseClass -> subClass2
The abstract base class should have 2 instance variables (type id?) and setters and getter for thous variables … the thing is that the variables in subclass 1 need to be of tpye NSNumber and NSSTring , and in the other subclass both will be NSNumber… Do I just inherit the base class and overwrite the setters and getters to cast NSNumber to the id of the super-class?
I want to create a class hierarchy something like this: AbstractBaseClass – > SubClass1,
Share
If you create
idtype properties in the base class, you should be able to use them to store any type of object without doing anything extra in the subclasses.Somewhat weird example: 🙂