문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top