• 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: NSMutableArray: where is addObjectIfAbsent:?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableArray: where is addObjectIfAbsent:?


  • Subject: Re: NSMutableArray: where is addObjectIfAbsent:?
  • From: Brian Webster <email@hidden>
  • Date: Wed, 26 Jun 2002 09:00:26 -0500

On Wednesday, June 26, 2002, at 12:05 AM, cocoa-dev-
email@hidden wrote:

OK, I'm maybe late on this one, but why didn't this method make OS X? I
remember pretty well that it was in NeXTSTEP/OPENSTEP. That forces me to add
an additional test and a an additional line of code...

Any reason I can't see?

Well, there are probably hundreds of little utility methods like this that _could_ be implemented by Apple, but if they did implement every one of them, they would end up with a much more complicated and bloated class than they do now.

I think the aim when creating a framework is to try to implement the methods that people use all the time, as you don't want to have lots of dead code lying around in the frameworks that only get called by 1-2% of programs (just look at the Java libraries sometime). Some methods might seem like obvious additions to some people, but other people may never have a need for them. Plus, if you really want a particular method, you can write a category for it, so it's not really a huge deal most of the time.

BTW, I don't know if this would apply well to your particular situation, but you could consider using an NSMutableSet instead, as it would be much faster for this type of insertion.

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.

  • Prev by Date: Re: Using afterDelay: ? (2)
  • Next by Date: Re:Using afterDelay: ? (2)
  • Previous by thread: Re: exchangeObjectAtIndex (was NSMutableArray: where is addObjectIfAbsent:?)
  • Next by thread: Re: NSMutableArray: where is addObjectIfAbsent:?
  • Index(es):
    • Date
    • Thread