• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Collection classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Collection classes (From: T Reaves <email@hidden>)
 >Re: Collection classes (From: Todd Blanchard <email@hidden>)
 >Re: Collection classes (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Re: Thinking about shareware prices... (was a question about NSDate inside userDefaults)
  • Next by Date: Re: Distributed Object problems
  • Previous by thread: Re: Collection classes
  • Next by thread: Re: Collection classes
  • Index(es):
    • Date
    • Thread