• 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: Building a tree
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building a tree


  • Subject: Re: Building a tree
  • From: Graham Cox <email@hidden>
  • Date: Sun, 15 Nov 2009 12:17:03 +1100

On 12/11/2009, at 8:01 PM, Jonathan Guy wrote:

> I'm having a hard time finding a good example of this on the web so I thought I'd post here. I have an array of file system paths (NSStrings) and need to convert this into a tree structure using parent child tree node objects. The method has to be as efficient as possible as it will be crunching a lot of data. Any pointers to documentation or a good example would be much appreciated.


I make no claims for its efficiency, but I have public code that does exactly this:

http://apptree.net/gcfolderbrowser.htm

While I present it as a user interface controller, the code internally models the file system paths as a tree, and does so as lazily as possible - in other words it doesn't enumerate folders unless the user interface actually needs to display them, and then it caches the results when it does, so it's not hitting the disk any more than necessary.

--Graham


_______________________________________________

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

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Building a tree (From: Jonathan Guy <email@hidden>)

  • Prev by Date: Re: Stack-based C++ class to wrap NSAutoreleasePool
  • Next by Date: Where are the interface builder components?
  • Previous by thread: Re: Building a tree
  • Next by thread: [iPhone] OS 3.0 and @synthesize AND @dynamic for the same property
  • Index(es):
    • Date
    • Thread