0

ここに私のコードスニペットがあります:

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:] でのアサーション エラー」</p>

4

1 に答える 1