Re: Collection classes
Re: Collection classes
- Subject: Re: Collection classes
- From: Jim Rankin <email@hidden>
- Date: Thu, 8 Jan 2004 17:30:07 -0500
On Jan 8, 2004, at 12:09 PM, Timothy Reaves wrote:
>
If I wanted to add a class, an NSOrderedSet would be very easy to
>
create composing an array into it, and wrapping all the mutators with
>
the check you suggest.
How about implement NSOrderedSet yourself? It will have an
NSMutableArray for an ivar, but only expose methods for adding objects
that check to see if the array already contains the object. Then just
write cover methods for whatever other functionality you need that call
through to the array and you're done.
forwardInvocation: (see NSObject docs) can help with this. You can
implement this to just forward the messages to the array that you want
to include in your contract.
Best,
-jimbo
Excelsior! XML Marshaller for Cocoa
http://www.homepage.mac.com/jimbokun/Excelsior.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.