I am using bindings for the first time on a core data store with a one to many relationship on my entities, I display the subItems using an NSCollectionView which shows an image and a title.
Objects are:
Subitems Array Controller (NSArrayController)
Collection View Item (NSCollectionViewItem)
Controls are:
NSCollectionView
NSView (for the item)
NSImageView
NSTextField
I have bound the NSImageView to Collection View Item with model key path as representedObject.imagePath and a value transformer. This all works well.
What I want to do though is detect a double click on the item in code and gain access to the representedObject of the double clicked item.
I tried to subclass NSImageView and override the mouse event for a click event which worked but then I couldn't get access from here to the ManagedObject Context and selected object. I am not sure how to do this the correct way.
Thanks for any help, I understand this is basic stuff and I must be doing something incorrect with the bindings implementation.