Observe selection
key of the NSArrayController
(it is inherited from NSObjectController
).
It will return either NSMultipleValuesMarker
(when many objects are selected), NSNoSelectionMarker
(when nothing is selected), or a proxy representing the selected object which can then be queried for the original object value through self
key.
It will not change if rearranging objects did not actually change the selection.
You can also observe selectedObjects
; in that case you won't need to deal with markers.