I have some code which subclasses NSWindow to tack on some data of
my own:
<snip>
I've run up against this problem with views as well, and I've
managed to get some mileage out of categories, but there are a lot
of situations where you just need to add members.
So what is the best design pattern for something like this?
Anything nicer than a good old fashioned #define?
There is another trick with categories which access a static (global)
dictionary with keys which are the objects to be extended and values
with the additional storage. Nu does this, I believe to make Obj-C
objects more dynamic.
It's easy to implement and make a transparent API, but the downside
is slower (less thread-friendly) access and a clunky, sinking feeling.
Cheers,
M
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com