Hier ist mein Code-Schnipsel:Was kann den Fehler "Assertionsfehler in - [UICollectionViewData numberOfItemsBeforeSection:]" verursachen?
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];
}];
Was ist der Grund für diesen Fehler?
„Assertion Fehler in - [UICollectionViewData numberOfItemsBeforeSection:]“