• 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: NSArray lookup, pointer comparison
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArray lookup, pointer comparison


  • Subject: Re: NSArray lookup, pointer comparison
  • From: Andrew Farmer <email@hidden>
  • Date: Tue, 29 May 2007 14:12:13 -0700

On 29 May 07, at 10:51, Keith Duncan wrote:
I'm iterating over a tree of objects but instead of iterating the tree multiple times I decided to iterate the tree once and put the nodes into an array. This allows me to check for the presence of various objects quickly, for the purposes of this discussion two objects are deemed to be equal if a pointer comparison is true.

Essentially what I'm looking for is the quickest way to determine if any of the objects stored in another array, are no longer present in the content array, that is the array derived from the content tree.

Use an NSSet instead of an array? NSSet has a containsObject: method, which should be much faster than scanning over an array.
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSArray lookup, pointer comparison
      • From: Keith Duncan <email@hidden>
References: 
 >NSArray lookup, pointer comparison (From: Keith Duncan <email@hidden>)

  • Prev by Date: Re: Disabling items in NSTabView
  • Next by Date: Re: How to draw a rectangle around a (graph) view?
  • Previous by thread: Re: NSArray lookup, pointer comparison
  • Next by thread: Re: NSArray lookup, pointer comparison
  • Index(es):
    • Date
    • Thread