Re: NSTableView column bindings and "deep" key paths
Re: NSTableView column bindings and "deep" key paths
- Subject: Re: NSTableView column bindings and "deep" key paths
- From: Quincey Morris <email@hidden>
- Date: Thu, 14 Jan 2010 11:32:54 -0800
On Jan 14, 2010, at 08:47, Gerd Knops wrote:
> I have a typical NSTableView setup where the column content is provided by an NSArrayController.
>
> Now say a column is bound to arrayController.arrangedObjects key path a.b.c.d.
>
> In this scenario if "b" changes (even in a KVO-complient way), it will still result in an NSInternalInconsistencyException 'Cannot remove an observer xxx for the key path "c.d" from <old instance of "b">, most likely because the value for the key "c" has changed without an appropriate KVO notification being sent.'
>
> I understand why this is happening (nothing is observing changes of "b", so the actual observer is left "dangling").
>
> The question is how can I change my design to avoid this situation?
But something *is* observing changes to "b" -- the KVO mechanism. Whether it literally adds an observation of every object along the key path, or whether it has private methods for observing the whole string of objects in an optimized way, it doesn't matter.
The first question to be answered is: Are you *sure* that the "c" property of the "b" objects is updated KVO-compliantly? The error message is telling you that it is apparently not.
_______________________________________________
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