> On Tue, 2009/05/05, WT <jrca...@gmail.com> wrote: > From: WT <jrca...@gmail.com> > Subject: Re: A tree data structure? > To: "Cocoa-Dev List" <cocoa-dev@lists.apple.com> > Date: Tuesday, 2009 May 5, 12:19 > Please let's not forget that a tree data structure > is often pretty much useless without some form of > balancing...
The OP's post reminds me of a couple of mine back around 2001, asking for threaded trees and graphs and linked lists and such (with bi- directional links and built-in support for other threadng schemes). You can always whip up a quick index into the more complex data forest, as you build the trees or after, if walking the structure isn't fast enough. I'm more concerned about how to manage what owns the tree or forest (and the index), so that it stays around and is accessible as long as necessary, but no longer. I understand that setters can do an autorelease and then the caller do a retain as one way to pass ownership up the line. I might have a user who opens several files, the data gets imported, converted, reorganized, and then added to a model tree. The user is likely to attach trees at particular node(s), display these trees in various ways in multiple windows and save the model tree in my native format (or an export file format), most likely after doing some editing in my editing interface(s) to the model data. Maybe he opens or imports various trees along the way, does some work, sometimes saves changes, and closes some of the trees, or just releases the file and the associated NSData object once I've got the data in model form. What I don't get is how the life-cycle of whatever object(s) own the tree, and of the tree itself, fit into the application's execution and event cycles. Sure, we've got model, controller and view/interface. And we automagically have a couple threads going. And the tree should be part of/owned by the model, fed back and/or forth through the controller to/from the interface(s), but just at the moment, I'm missing some glue or fasteners somewhere. _______________________________________________ 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