FROM : Alex Majora
DATE : Fri Dec 03 19:33:26 2004
I am on a very large project, so I've established a common custom class,
MyObject, inserted beneath NSObject for all of our objects that inherit
directly from NSObject; In this way, we can add all of our common
functionality and instance variables there, so there's no duplication
amongst the various classes.
So far so good.
However, for objects that necessarily must subclass from GUI elements like
NSImageView, NSQuickDrawView, etc., I don't see a way to do this.
In general, I'm not a fan of multiple inheritance, but it would be handy in
this case. Simply adding a category to NSObject doesn't allow us to add
instance variables, so that's out. I don't see any way to "insert" a custom
class into an established hierarchy. And I certainly don't want to replace
NSObject, for obvious reasons. Any ideas?
Thanks!
Alex
DATE : Fri Dec 03 19:33:26 2004
I am on a very large project, so I've established a common custom class,
MyObject, inserted beneath NSObject for all of our objects that inherit
directly from NSObject; In this way, we can add all of our common
functionality and instance variables there, so there's no duplication
amongst the various classes.
So far so good.
However, for objects that necessarily must subclass from GUI elements like
NSImageView, NSQuickDrawView, etc., I don't see a way to do this.
In general, I'm not a fan of multiple inheritance, but it would be handy in
this case. Simply adding a category to NSObject doesn't allow us to add
instance variables, so that's out. I don't see any way to "insert" a custom
class into an established hierarchy. And I certainly don't want to replace
NSObject, for obvious reasons. Any ideas?
Thanks!
Alex
| Related mails | Author | Date |
|---|---|---|
| Alex Majora | Dec 3, 19:33 | |
| j o a r | Dec 3, 20:44 | |
| Jim Thomason | Dec 3, 21:01 | |
| Ken Anderson | Dec 3, 21:07 | |
| Jim Thomason | Dec 3, 23:17 | |
| Ken Anderson | Dec 3, 23:59 | |
| Shaun Wexler | Dec 4, 00:11 | |
| Shaun Wexler | Dec 4, 00:12 | |
| The Karl Adam | Dec 4, 00:38 | |
| M. Uli Kusterer | Dec 4, 08:58 | |
| Shaun Wexler | Dec 5, 01:49 |






Cocoa mail archive

