I have a UICollectionView
, and I use reloadItemsAtIndexPaths:@[path]
to update it. However, sometimes, not quite often, I got a crash from reloadItemsAtIndexPaths:@[path]
. I have been thinking about the reason, but cannot figure out one.
Could some one share some ideas about this? e.g. how to narrow down the bug, add what log messages, etc. and possible reason for it?
The trace shows:
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x0000000000000010
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x0000000192a63bd0 objc_msgSend + 16
1 UIKit 0x000000018714e88c -[UICollectionViewFlowLayout _updateDelegateFlags] + 88
2 UIKit 0x000000018714f83c -[UICollectionViewFlowLayout _fetchItemsInfoForRect:] + 304
3 UIKit 0x0000000186c2877c -[UICollectionViewFlowLayout prepareLayout] + 184
4 UIKit 0x0000000186b1296c -[UICollectionViewData _prepareToLoadData] + 76
5 UIKit 0x0000000186c8b17c -[UICollectionView _endItemAnimations] + 7780
6 MCompass 0x0000000100052270 reloadItemsAtIndexPaths: