0
は私のコードスニペットです:"[UICollectionViewData numberOfItemsBeforeSection:]"でアサーションエラーが発生する原因は何ですか?ここ
NSIndexSet *indexSet = self.selectedIndexSet;
__block SGPhotoSelectorCell *cell;
[indexSet enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) {
NSLog(@"%lu", (unsigned long)idx);
***NSIndexPath *indexPath = [NSIndexPath indexPathWithIndex:idx];***
cell = (SGPhotoSelectorCell *)[collectionView cellForItemAtIndexPath:indexPath];
cell.numLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)idx];
[collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone];
}];
このエラーの理由は何ですか?
「のアサーションの失敗 - [UICollectionViewData numberOfItemsBeforeSection:]」