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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to