나는 코코아 신청서에 NSCollectionView
이 있습니다.코코아 - 컬렉션보기에서 현재 선택된 객체를 얻는 방법?
나는 다음과 같은 로터리 방식을 통해 컬렉션 뷰에서 현재 선택한 개체에 대한 정보를 얻을 수 있습니다 :
NSIndexSet* index = [self.currentCollectionView selectionIndexes];
CardModel* card = [[self.currentCollectionView itemAtIndex:index.firstIndex] representedObject];
는 NSCollectionView
클래스가 선택한 개체를 반환하는 방법이 있습니까를? 아니면 이것에 대해 선호하는 방법입니까?