Pergunta

I was using an NSCollectionView to show a list of pictures in the binded array controller, also, I want to add a delete button on the left-top corner of each picture so that when someone press the button, it will remove the corresponding object in the array controller.

However, when I tried to make the NSCollectionViewItem a subclass of my custom class, and set action of the delete button to a method written in my custom class, It reports an error like

'Could not connect the action XXX: to target of class NSCollectionViewItem'

Also, I failed when trying to add an array controller object in the NIB file.

What should I do to make everything OK?

Foi útil?

Solução

It seems we can add a button in the default Protype of the CollectionView, and link it's target to the controller.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top