AWF4vk
AWF4vk

Reputation: 5890

How to bind a NSMutableArray to NSArrayController's selection?

I have NSMutableArray (arr1), and NSArrayController for that arr1.

I'd like to have another NSMutableArray's content to be the selection of the NSArrayController.

Upvotes: 1

Views: 544

Answers (1)

Peter Hosey
Peter Hosey

Reputation: 96363

You can observe the array controller's selectedObjects informal property using KVO, and apply the changes to your own array.

There's no documented way to set that up any more automatically than that. I've had success setting up custom bindings without overriding the bind:::: method in views, but not in non-views, so I wouldn't consider that reliable.

Upvotes: 1

Related Questions