删除部分时,UICollectionView崩溃 [英] UICollectionView crashes when deleting section
本文介绍了删除部分时,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%的时间),并出现以下错误:
my app crashes sometimes (10% of the time) with this error:
*** Assertion failure in -[UICollectionView _endItemAnimations], /SourceCache/UIKit_Sim/UIKit-2903.2/UICollectionView.m:3700
有什么想法可能有问题吗?
Any thoughts on what might be wrong?
删除之前提供的操作单是否有潜在问题?
Is the action sheet, which is presented before the deletion, a potential problem?
我需要在删除收藏夹视图"部分之前手动将其关闭吗?
Do I need to dismiss it manually before deleting the collection view section?
推荐答案
在 viewDidDisappear
这篇关于删除部分时,UICollectionView崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文