1. 程式人生 > >iOS CollectionView重新整理indexPath變化問題

iOS CollectionView重新整理indexPath變化問題

今天出了一個很奇怪的問題:

使用CollectionView,網路請求更新資料,使用[collectionView reloadData]方法,結果indexPath變化,導致資料錯亂問題

解決辦法:

使用針對某一個section更新資料

[self.collectionViewreloadItemsAtIndexPaths:@[[NSIndexPathindexPathWithIndex:0],[NSIndexPathindexPathWithIndex:1]]];

君凱商聯網-iOS-字唐名僧