2016-03-04 97 views
0

我重裝secion當請求數據是成功。該方法是:UICollectionView重載一些區段崩潰

[self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];

NSIndexPath *idx = [NSIndexPath indexPathForItem:0 inSection:1]; 
    [self.collectionView reloadItemsAtIndexPaths:@[idx]]; 

,這是控制檯輸出:

[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.30.14/UICollectionView.m:4324 

這個問題偶爾會發生!

在此先感謝!

+0

你能發佈崩潰日誌嗎? – jarryd

+0

把你的代碼放在https://developer.apple.com/reference/uikit/uicollectionview/1618045-performbatchupdates –

回答

0

看來你的數據可能會改變可變

請使用

[self.collectionView reloadData] 
+0

我的集合的每個部分都有不同的數據,最後一部分可以加載更多。但reloadData性能低於reloadSections – taitanxiami

+0

請檢查一次,如果它可以解決您的問題 – techloverr

+0

是的,它可以解決我的問題。但我想爲什麼? – taitanxiami

0

我有同樣的問題。當其他部分的項目數量發生改變時,會發生這種情況,但您只需重新加載其中一個更改部分。