DeepDiff icon indicating copy to clipboard operation
DeepDiff copied to clipboard

Crash: attempt to delete item 20 from section 0 which only contains 20 items before the update

Open ageevvalentin opened this issue 5 years ago • 3 comments

I gets crash: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to delete item 20 from section 0 which only contains 20 items before the update'

My changes: First Changes insert(0), insert(1), insert(2), insert(3), insert(4), insert(5), insert(6), insert(7), insert(8), insert(9), insert(10), insert(11), insert(12), insert(13), insert(14), insert(15), insert(16), insert(17), insert(18), insert(19) Second Changes insert(0), insert(1), insert(2), insert(3), insert(4), insert(5), insert(6), insert(7), insert(8), insert(9), insert(10), insert(11), insert(12), insert(13), insert(14), insert(15), insert(16), insert(17), insert(18), insert(19), update(20(was 0)) Crash!

I think changes update(20) should be update(0). Maybe collection view sees the changed items before inserted

ageevvalentin avatar Nov 28 '19 15:11 ageevvalentin

Message that will be displayed on users' first issue

github-actions[bot] avatar Nov 28 '19 15:11 github-actions[bot]

Yes, UICollectionViewUpdateItem has indexPathBeforeUpdate and indexPathAfterUpdate. To use it with batch updates, you must use the following paths: Insert - new index Remove - old index Change - old index

ageevvalentin avatar Nov 28 '19 18:11 ageevvalentin

Yes, UICollectionViewUpdateItem has indexPathBeforeUpdate and indexPathAfterUpdate. To use it with batch updates, you must use the following paths: Insert - new index Remove - old index Change - old index

Please give some reply in detail?, with some code reference

harielakanti avatar Nov 09 '20 13:11 harielakanti