NSViewController's representedObject and NSArrayController's selection don't mix?
NSViewController's representedObject and NSArrayController's selection don't mix?
- Subject: NSViewController's representedObject and NSArrayController's selection don't mix?
- From: Jacob Lukas <email@hidden>
- Date: Sun, 6 Apr 2008 22:52:04 -0400
I have a table of Core Data objects and a set of inspector views.
Depending on the Class(es) of the selection in the table view, the set
of inspector views changes.
I managed the inspector views with NSViewControllers. The fields in
the inspector view are bound to the view controller's
representedObject -- ex. representedObject.radius. This works, but
when I add a deeper path to the mix (ex.
representedObject.material.refractionIndex), I get the following
message in the console when the selection changes:
2008-04-06 22:35:40.095 RayT[14429:10b] Cannot remove an observer
<NSKeyValueObservance 0x11434b1c0> for the key path
"material.refractionIndex" from <_NSControllerObjectProxy
0x114329b30>, most likely because the value for the key "material" has
changed without an appropriate KVO notification being sent. Check the
KVO-compliance of the _NSControllerObjectProxy class.
The first selection works, but each selection change after that
trigger this message.
Since the applicable inspector views change, I set their
representedObject just before adding them to the screen:
[controllers
makeObjectsPerformSelector:@selector(setRepresentedObject:) withObject:
[configController selection]];
Where controllers is the list of inspector views and configController
is the array controller. If I precede this by first setting the
representedObject to nil, I get the message every other selection
event, rather than every event.
Can anyone help shed some light on this situation?
Thank you,
Jacob Lukas
_______________________________________________
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