UICollectionView在删除节时崩溃
当使用这个代码
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 0) { [self removeCompany:companySelectedInActionSheet]; NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex: indexPathSelectedInActionSheet.section]; NSLog(@"IndexSet to delete from collection view: %@",indexSet); [self.collectionView deleteSections:indexSet]; } }
我的应用有时会崩溃(10%的时间)与此错误:
*** Assertion failure in -[UICollectionView _endItemAnimations], /SourceCache/UIKit_Sim/UIKit-2903.2/UICollectionView.m:3700
有什么想法可能是错的?
在删除之前提交的操作表是一个潜在的问题吗?
在删除集合视图部分之前,是否需要手动解除它?
在viewDidDisappear
中将你的表视图委托设置为nil