Iglistkit: Reloading data with other set of objects results in crash or weird behaviour

Created on 17 Apr 2017  路  3Comments  路  Source: Instagram/IGListKit

New issue checklist

General information

  • IGListKit version: 2.1
  • iOS version(s): 9.3.5 / 10 +
  • Xcode version: 8.3
  • Devices/Simulators affected: all
  • Reproducible in the demo project? (Yes/No): no

I have simple view with segmented control below nav bar, and IGCollectionView as my list.
Switching between segments simply reloads data on list.

To reload data on iOS 10, i used
self.adapter.performUpdates(animated: true)
then and everything was fine, on iOS 9.3.5 this crashed with EXT_ARITHMETIC (code=EXCI386_DIV, subcode 0x0)
part of print stack:

#0  0x02fbff55 in -[_UIFlowLayoutSection frameForItemAtIndexPath:] ()
#14 0x02f3e01b in -[UICollectionView performBatchUpdates:completion:] ()
#15 0x0193f9f2 in -[IGListAdapterUpdater performBatchUpdatesWithCollectionView:] at /Pods/IGListKit/Source/IGListAdapterUpdater.m:212
#16 0x01942b04 in __54-[IGListAdapterUpdater queueUpdateWithCollectionView:]_block_invoke at /Pods/IGListKit/Source/IGListAdapterUpdater.m:343

so i used
self.adapter.reloadData() and it resulted in "broken" list.
In segment A we have about 5 items, in segment B we have 100 items.
When top items of my list are visible, switching between segments A and B works fine.
When i scroll to last item in segment B, then back to segment A, first 2-3 items are messed up.

My poor sketches
unadjustednonraw_thumb_5fb

unadjustednonraw_thumb_5fc

How can i "safely" reload items on list? What i might be doing wrong?

Cheers,
CurlyHeir

question

All 3 comments

Thanks @CurlyHeir ! 馃槃

It's not really clear what's happening here. Can you provide more information?

Also, look the the example apps that we provide and try to see if you might be setting things up incorrectly.

so i got an answer - i used estimated size for cells, it worked pretty well for items with multi-line labels, cells was displayed properly, but it crash on data reload/ updates.

Switching to manual cell sizing helped.

I am having similar problems as well.
However, this problem does not occur with iOS 10 or higher.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhilCai1993 picture PhilCai1993  路  3Comments

racer1988 picture racer1988  路  3Comments

rnystrom picture rnystrom  路  3Comments

krysztalzg picture krysztalzg  路  3Comments

alexwillrock picture alexwillrock  路  3Comments