我的UICollectionView上有120个单元格。当我的查询结束其结果时,我调用下面的函数:
[self.collectionView performBatchUpdates:^{
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:92 inSection:0];
[self.collectionView deleteItemsAtIndexPaths: [NSArray arrayWithObjects:indexPath, nil]];
[self.collectionView reloadData];
// NSIndexPath *indexPath = [NSIndexPath indexPathFor];
// [self.collectionView deleteItemsAtIndexPaths: index];
// [self.collectionView.dataSource removeObjectAtIndex:index]; // First delete the item from you model
// [self.collectionView deleteItemsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:index]]];
}
completion:^(BOOL finished)
{
// Finished
}];
上面反而删除了屏幕上的几乎所有内容。为什么会这样?
感谢。