I have a custom UICollectionViewFlowLayout with non-zero estimatedItemSize for cells. I add and delete cells inside the View collection, reloading the data, and sometimes I get a failure when trying to scroll to the cell that has just been deleted / added.
Using the backtrace tool, I get the following result:
frame # 9: 0x0000000185c8385c CoreFoundation - [__ NSArrayM objectAtIndex:] + 264 frame # 10: 0x000000018aeabb18 UIKit - [_ UIFlowLayoutSection setSize: forItemAtIndexPath:] + 708, frame # 11: 0x000000018ae7cc5c UIKit- [UICollectionViewFlowLayout invalidationContextForPreferredLayoutAttributes: withOriginalAttributes:] + 156 frame # 12: 0x000000018ae646c4 UIKit- [UICollectionView _checkForPreferredAttributesInView: originalAttributes:] + 212 frame # 13: 0x000000018a844968 UIKit- [UICollectionView _createPreparedCellForItemAtIndexPathttutes: 7outayoutoututayoutoututayoututa
I have an assumption that my stream layout may cache cells.
UPDATE: My problem appears in iOS 8.3, but not in previous versions, including 8.2.
source share