I've got a NSCollectionView
bound to my array of model objects, the NSView
prototype to render items of the collection view is set up to use my custom NSView
subclass.
At runtime a (generic) view is shown/instantiated in the collection view for each array element, all good.
However, I just can't figure out how to get to my array objects from the individual view instances to render the actual data that's specific to each element in the array.
I.e. how are we supposed to hook up data to the NSView
prototype that is used to configure a 'cell' in the collection view?
Outlets don't seem to work for that particular view; they're all nil
at runtime.
Bindings don't work with a vanilla NSView
(apart from hidden and tooltip bindings for vanilla views..) - and we cannot add new bindings that would show up in IB for our NSView
subclasses, can we?
Any hint appreciated!
Nevermind - I've settled with a custom NSCollectionView
class overriding only
- (NSCollectionViewItem *)newItemForRepresentedObject:(id)object
to access the item view of NSCollectionViewItem
instances created by super
and set the required property there.