我对NSCollectionViewDelegate进行了扩展,在其中我声明了两个新函数来处理NSCollectionViewItems上的点击。我从自定义NSCollectionViewItems子类调用委托(delegate)方法,并在我的ViewController中将collectionView的委托(delegate)设置为self。然而,新函数是在NSCollectionViewDelegate中调用的,而不是在我的ViewController中调用的。我的NSCollectionViewDelegate扩展:extensionNSCollectionViewDelegat