NSTreeController KVO
NSTreeController KVO
- Subject: NSTreeController KVO
- From: "Hamish Allan" <email@hidden>
- Date: Mon, 7 Apr 2008 01:30:39 +0100
Hi,
I have an NSOutlineView bound to an NSTreeController, in turn bound to
an NSMutableArray whose contents are:
(
{
children =
(
{ displayName = "child 1"; },
{ displayName = "child 2"; }
);
displayName = "parent";
}
)
The bindings are set up as you might expect such the the NSOutlineView
displays the heirarchy correctly. All dictionaries and arrays within
are mutable.
If my model is updated with [[myRootArray objectAtIndex:0]
setObject:@"new parent description" forKey:@"displayName"], the
parent's name is updated correctly in the NSOutlineView.
If my model is updated with [[[[myRootArray objectAtIndex:0]
objectForKey:@"children"] objectAtIndex:0] setObject:@"new child 1
description" forKey@"displayName"], the first child's name is updated
correctly in the NSOutlineView.
However, if my model is updated with [[[myRootArray objectAtIndex:0]
objectForKey:@"children"] addObject:[NSMutableDictionary
dictionaryWithObject:@"child 3" forKey:@"displayName"]], the
NSOutlineView is not updated.
That is to say, though the objects contained within the children array
are being observed, the array itself appears not to be.
Is this expected behaviour? If so, how can I best work around it?
Thanks,
Hamish
_______________________________________________
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