Re: NSTreeController, Core Data and root objects
Re: NSTreeController, Core Data and root objects
- Subject: Re: NSTreeController, Core Data and root objects
- From: Steve Steinitz <email@hidden>
- Date: Fri, 6 Nov 2009 17:15:58 +1100
Hi Rob,
Rob Keniger wrote
What I've tried, which does seem to work, is overriding
-insertObject:atArrangedObjectIndexPath: and setting the parent
explictly if the item is being inserted at the top level:
...
Can anyone see anything wrong with this?
I don't see anything wrong. In fact, it looks great. Does
insertObjects:: call insertObject:: so that one day, if you
implement drag and drop for multiple items it will all work?
One possible tweak: since you've already subclassed
NSTreeController would be worth overriding its awakeFromNib to
cache the root object? Is the root object unchanging? Then
insertObject:: would be short and sweet.
Cheers,
Steve
_______________________________________________
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