【发布时间】:2016-07-18 08:33:31
【问题描述】:
这是我的代码 sn-p:
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:] 中的断言失败”
【问题讨论】:
标签: ios uicollectionview nsindexset