On Jan 1, 2018, at 01:46 , Motti Shneor <motti.shn...@me.com> wrote:
> 
> Selected Object  bound to Measurements Array Controller, Controller Key: 
> arrangedObjects, Model Key Path: species, Allows Editing Multiple Values 
> Selection, Conditionally Sets Enabled, Creates Sort Descriptor

Your functional problem is here. You need to bind “Selected Object” to a 
*single* object, but you’ve bound it to the array of measurements. If you only 
have one row selected, it sort of works because bindings “deliberately” 
conflates an object with an array of one object or an array of the same object 
repeatedly, because … bindings. As soon as you have multiple rows selected, the 
functionality goes south.

Secondarily, your intention seems to be that choosing the popup in *one* of the 
selected rows should change the species in *all* of the selected rows. You 
can’t (or, probably can’t, though there might be a trick that does it) use a 
per-row control like this, and you’ll have to write code to transfer the 
per-row choice to all the other selected rows. The correct UI for this is to 
use a detail view — IOW, put the popup button outside the table, and have that 
single button reflect the species of the selected row, or of the selected rows. 
In that case, you might be able to get the desired functionality by binding 
“Selected Object” the Measurement Array Controller’s “selection” or 
“selectedObjects” controller key.

> When the content of a popup-button-cell is populated by binding - Can I still 
> apply NSMenu Validation protocol to that menu, and Filter/Enable/Disable menu 
> items as user clicks to open the menu?
> When the editing is done via the “Selected Object” binding - can I still 
> somehow intervene and “Catch” the change in code before it happens?

You can use KVC’s validation protocol (validate<Key>) with bindings, but you’re 
limited in what you can change.

But, how you proceed with this depends on whether you really want one menu 
choice to change all selected rows or just one row.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to