UICollectionView删除单元格无法正常工作

时间:2015-07-27 03:59:23

标签: ios objective-c uiviewcontroller uicollectionview

我的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
}];

上面反而删除了屏幕上的几乎所有内容。为什么会这样?

感谢。

0 个答案:

没有答案