簡體   English   中英

刪除部分時,UICollectionView崩潰

[英]UICollectionView crashes when deleting section

使用此代碼時

  - (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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM