-
-
Notifications
You must be signed in to change notification settings - Fork 143
NSInternalInconsistencyException: reason: 'attempt to delete row 0 from section 0, but there are only 0 sections before the update' #8
Comments
@rkittinger I haven't seen this problem. Maybe your data has changed to 0 just before DeepDiff finishes ? |
We seemed to have fixed the problem above, but crashes in this case:
error: |
@rkittinger I hit the issue you're describing. I've been using Differ in the past, but ran into the invalid update error and had to work around it. I thought it was an isolated case since I couldn't find any other issue describing the problem. Today I figured I'd give DeepDiff a try, to see if it had the same issue, and it does. I've found an article that explains the issue, and the proposed fix/workaround also worked well for me: https://fangpenlin.com/posts/2016/04/29/uicollectionview-invalid-number-of-items-crash-issue/ I've personally only hit it for collection views, not table views. Perhaps the new API for |
@Burgestrand Hi, I will try to look into https://fangpenlin.com/posts/2016/04/29/uicollectionview-invalid-number-of-items-crash-issue/ soon. Do you have a test or demo that reproduces this bug? |
A workaround is to check data source for number of objects before perform changes of diffing. This can be added to DeepDiff or users must do this before calling |
@onmyway133 I'm experiencing the same issue and would like to try to solve it. I suppose one could let the client call into DeepDiff to get value that the clients needs to return from function numberOfItemsInSection thus returning the appropriate values depending on the phase of any current batch operation (as proposed in the linked article above). Do you have any other ideas on how to implement the fix in DeepDiff? |
@rkittinger @snoozemoose @Burgestrand Hi, I just introduced |
When I remove, the number/ranking on the leaderboard does not update. |
I am using ver.1.1.1 and the app crashes sometimes with:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to delete row 0 from section 0, but there are only 0 sections before the update'
Has this been fixed in 1.1.2? I saw here that it could take a while to fix: https://medium.com/flawless-app-stories/a-better-way-to-update-uicollectionview-data-in-swift-with-diff-framework-924db158db86
The text was updated successfully, but these errors were encountered: