Is there a way to use an
Yes, and you don't need to subclass it.
You can use the
content property to give the
NSCollectionView and array of objects. For each one of those objects, the collection view will manufacture a new
itemPrototype and setting its
representedObject property to the corresponding item in the
So what I did when I did this was to create a subclass of
NSCollectionViewItem and then overrode its
setRepresentedObject: method to receive the new object, forward it on to
super, and then customize the collectionViewItem appropriately. No subclassing of
NSCollectionView was required. (But don't forget to implement
-copyWithZone:!) I simply
alloc/inited one of these custom collectionViewItems and set it as the collectionView's
NSCollectionView did the rest.