I have a NSCollectionView
is bound to an NSArrayController
that has an NSMutableArray
as content. Items in the NSMutableArray
are displayed as they should.
I have an WindowController class that holds a reference to the NSMutableArray
. There is also a button that causes a buttonClicked
message to be sent to my WindowController.
Now inside buttonClicked
I want to know what item is selected in the NSCollectionView
. How do I do this? I have no reference to the NSArrayController
otherwise I could have asked it by sending selection
. I've studied some sample code but to no avail.
How can I get a reference to the currently selected item in the NSArrayController
?