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:]」