You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Silently clearing its data while the collection view is still being used, without notifying the backing UICollectionView, puts it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that clearData was called, making it extremely tricky to investigate and identify the root cause.
The text was updated successfully, but these errors were encountered:
The original reason for why this clearing data was added is to ensure that the interfaceState is zero’d out in the collection dealloc case.
@nguyenhuy What do you think, would it be enough to call reloadData on the collection itself in this case, or at least invalidateLayout? After really making sure the reason for the crash in the stack trace is clearing the data as we talked in the past we should look what the root cause is in the first place.
I kind of get the issue. But I think it would be best to have a stacktrace when it occurs.
I can imagine that when the cell node are deallcoated at the end of the hosting collection view lifecycle, their interface state aren't updated properly because we never do so. A proper fix would be to directly/indirectly update those states. Directly means walking through all (visible) cell nodes and set manually reset the state. Indirectly means somehow trigger the collection view to update its dataset and ranges, for example by calling reload data as you suggested above.
Silently clearing its data while the collection view is still being used, without notifying the backing UICollectionView, puts it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that
clearData
was called, making it extremely tricky to investigate and identify the root cause.The text was updated successfully, but these errors were encountered: