0
在最简单的例子,我可以证明,我试过,我试图从UICollectionView
删除项目,但我总是得到一个错误的不一致:我该如何做到这一点UICollectionView.deleteItemsAtIndexPaths在Swift中正确?
'NSInternalInconsistencyException', reason: 'attempt to delete item 0 from section 1, but there are only 1 sections before the update'
self.collectionView!.performBatchUpdates({
self.collectionView?.deleteItemsAtIndexPaths([NSIndexPath(forItem: 0, inSection: 1) ])
}, completion: nil)
如果你能告诉我一个完整的方法的完整工作示例,这将是有益的。
只是为了澄清,你其实只需要在您的收藏视图中的一个部分?如果是这样,你需要NSIndexPath(forItem:0,inSection:0) – geraldWilliam