Re: what do I need the NSArrayController for?
Re: what do I need the NSArrayController for?
- Subject: Re: what do I need the NSArrayController for?
- From: Seth Willits <email@hidden>
- Date: Wed, 02 Apr 2014 17:02:15 -0700
On Apr 2, 2014, at 4:34 PM, Roland King <email@hidden> wrote:
> That sent me into the documentation to find that indeed there *is* a selected object property on NSArrayController, but it's a *property* not a binding.
Note that the selection property value is a proxy which can represent a single object, multiple objects, no object, etc. So don't expect it to be a single instance of your class.
> But there's more. That diagram also shows how the selected weapon flows back to the Combatant (thus meaning a combatant can only have one selected weapon :) ). That binds the property selection.selectedWeapon to a binding called .. selectedObject. Where is that binding? I checked the documentation and can find that on pop up buttons and matrices but not on a table view nor an NSArrayController.
The weapon control is a popup, not a table view. It's showing the selectedObject binding of the NSPopUpButton.
> That example states it's IB-only, no code required, is it just out of date? If it is, is there a way one could use bindings to accomplish what it's doing there, binding the selected object in a detail array directly back to a property on the selected object in the master?
It's valid as is.
The popup items are the weapons the combatant has (obtained via the first array controller's selection.weapons path), and then the selected item in that popup is determined by binding to the combatant's selectedWeapon (via the first controller's selection.selectedWeapon path)
--
Seth Willits
_______________________________________________
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