objective c - How to overwrite parent properties (redeclaration of parent property as a static variable)? -
it possible have type in parent class subclass overwrites? the idea here have shape class, subclasses of rectangles, square, circles, etc. wondering if it's possible overwrite definition of 'shapetype' int property in parent class. this? e.g. in globals.h #define kshapetype_rectangle = 1 #define kshapetype_square = 2 #define kshapetype_triskaidecagon = 13 // try pronouncing this! in shape.h @interface shape : nsobject @property int shapetype; @property int shapeid; @property uicolor shapecolor; @end .... in rectangle.h #import globals.h @interface rectangle : shape @property static (nonatomic, readonly) int shapetype = kshapetype_rectangle; // how working? @end so 2 questions: 1) such thing possible - i.e. redeclaration of parent property static variable 2) yes or no (1), best coding style sort of thing? i'm not experienced in obj-c patterns, if 1 exists, suggest source me @ please? thanks lot! there no concept of objec