I have a UICollectionViewFlowLayout
with an estimatedItemSize
set.
When I run my application, everything works fine, but in my unit tests, I get an EXC_ARITHMETIC
crash every time I hit collectionView:dequeueReusableCellWithReuseIdentifier:
.
I know this is due to my estimatedItemSize
as removing it fixes the crash.
Does anyone have any idea why this is happening?
Thanks
I have the same problem with UICollectionViewFlowLayout and estimatedItemSize. I filed a radar and Apple closed it as a duplicate with no further suggestions as a workaround. My best guess and research thus far indicates that self-sizing cells are fundamentally broken on iOS 8 / 9.
Try random values of estimatedItemSize. For me, setting sizes that closely match the resulting size of your cells cause a crash but sizes much smaller than your cells (1,1) for example do not crash.
I know this is not what you want to hear but it might be the only option until Apple fixes UICollectionView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With