3 ms·
Isn't it a bad idea to define private/protected properties in your implementation file? What if you want to subclass?
by archagon 13y ago
Isn't it a bad idea to define private/protected properties in your implementation file? What if you want to subclass?
- chromejs10 13y agoYou'll have to redefine the properties in the subclass's class and specify @dynamic so that it knows the properties were synthesized in the parent class
- archagon 13y agoI've experimented with putting the category in a private, implementors-only header file and it seemed to work fine. But I'm not sure if that's canonical.
- greatsuccess 13y agoAnd thats all bad and why inheritance and encapsulation in obj C are kind of rough on you. But on the other hand, it discourages something thats overused in other languages. Inheritance! Obj-C would do well to find a better composition mechanism to make most of the inheritance issues a secondary concern.