NSTreeController not updating model object properly
NSTreeController not updating model object properly
- Subject: NSTreeController not updating model object properly
- From: Jonathan Dann <email@hidden>
- Date: Thu, 14 Feb 2008 14:50:27 +0000
Hi Guys,
I have a source list in my app with an NSMutableArray content object
to which it is bound, and an NSOutlineView in IB with bindings to
display the value of the nodeName keypath of the object within the
content array. It has all been working fine except for one thing which
I fixed by categorizing the NSTreeController but the recent discussion
on KVO of arrays had made me rethink.
When I use drag and drop and NsTreeCobtroller's -moveNodes... method
the nodes are moved into the new group (non-leaf node) in the tree and
the children nodes in both the treeController and their 'real'
versions in the content object are updated, but only in the
treeController's representation of NSTreeNodes are they in the correct
order. In the model object all dragged nodes just get placed at the
end of the children array of the group I'm dragging them into
regardless of the index to which I drag them.
Is this normal behaviour as I have to perform them move then iterate
through the NSTreeNode children of the destination group following the
move, get their representedObjects and update the children array of
the model object with them!
Can I do some nice KVO KVC witchcraft to do this automatically?
Thanks!
Jonathan Dann
_______________________________________________
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