Re: NSOutlineView, NSTreeController and itemForPersistentObject...
Re: NSOutlineView, NSTreeController and itemForPersistentObject...
- Subject: Re: NSOutlineView, NSTreeController and itemForPersistentObject...
- From: Sebastian Morsch <email@hidden>
- Date: Tue, 1 Jan 2008 23:42:35 +0100
Hi,
I'm picking up this over two years old thread here to see if there was
anything new on this matter...
It's about the old problem how to translate back and forth between
NSTreeControllers private tree node proxies and our Core Data
NSManagedObjects. In Tiger, these tree node proxies belong to the
undocumented _NSArrayControllerTreeNode class. Now in Leopard,
apparently they are instances of the also undocumented
NSTreeControllerTreeNode class (the fact that the underscore is gone
gives me some hope though :-). Fortunately, you can throw
representedObject at those NSTreeControllerTreeNodes to get your
managed object back, but the other way round, getting a tree node
proxy with a managed object, seems impossible (at least for my very
limited knowledge and for everything I googled).
I came across this, while trying to implement the autosaving of
expanded/collapsed state of an NSOutlineView (bound to
NSTreeController bound to NSManagedObjectContext) in Leopard.
Implementing outlineView:persistentObjectForItem: was easy, but I
completely failed on outlineView:itemForPersistentObject:.
I know there are other solutions to this ( http://lists.apple.com/archives/cocoa-dev/2007/Dec/msg00982.html
), but I got curious if something less expensive is possible in
Leopard. And I think, Drag'n'Drop implementation presents you with the
same old problem, doesn't it?
Sebastian
_______________________________________________
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