创建了带有自定义CollectionViewCell的CollectionView应用。
添加了一个按钮"select all/deselect all" 对所有cell都有效,为了实现这点我用了一个循环:
for(customCollectionViewCell* cell in self.collectionView){
// some code
}
报警:
Collection expression type "UICollectionView *" many not correspond to "countByEnumeratingWithStage:objects:count"
然后我编译程序单击按钮,应用崩溃了:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICollectionView countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x7973e00'
谢谢高手的帮助。