onmyway133/DeepDiff

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

ageevvalentin opened this issue · 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

Message that will be displayed on users' first issue

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

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