On Apr 27, 2010, at 09:39, Keith Blount wrote:

> Many thanks for the reply, much appreciated. That makes sense - the only (or 
> rather difficulty) is ensuring the node always has an up-to-date reference to 
> its parent given the number of scenarios in which it could change (for 
> instance, if a node is copied etc).

Take a look at NSTreeNode to give you the tree structure with no work on your 
part. You could either use its representedObject property to hold a pointer to 
your MyNode objects (having removed their own parent/child properties), or 
subclass NSTreeNode as MyNode.

One extra advantage of using NSTreeNode is that it's already properly KVO 
compliant, which is important if you're going to bind an outline view to your 
tree. Was your home-grown implementation already KVO compliant? :)


_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to