QBImagePicker
QBImagePicker copied to clipboard
Crash in PhotoLibraryDidChange
Anybody else seeing a crashing problem?
The error is: uncaught ObjC exception, reason: attempt to delete and reload the same index path (<NSIndexPath: 0xc000000067e00016> {length = 2, path = 0 - 831})
Seems to happen when a person makes a change to a photolibrary. I believe it crashes in the block self.collectionView performBatchUpdates
Thanks, Chris
Is there anyway to work around of this issue? Since I see many of users who downloaded my app saw this crash issue.
The problem when user made changes in their photo library (for example share photos with others, or change photos on iCloud/synced with iTunes). Any work around or approach to solve this problem is a great help.
Here is a fix for the problem. I'll push it up when I get a chance. This is near the end of photoLibraryDidChange
Replace: [self.collectionView reloadItemsAtIndexPaths:[changedIndexes qb_indexPathsFromIndexesWithSection:0]];
with: NSMutableIndexSet *changedWithoutRemovalsIndexes = [changedIndexes mutableCopy]; [changedWithoutRemovalsIndexes removeIndexes:removedIndexes]; [self.collectionView reloadItemsAtIndexPaths:[changedWithoutRemovalsIndexes
It will then be: if ([changedIndexes count]) { NSMutableIndexSet *changedWithoutRemovalsIndexes = [changedIndexes mutableCopy]; [changedWithoutRemovalsIndexes removeIndexes:removedIndexes]; [self.collectionView reloadItemsAtIndexPaths:[changedWithoutRemovalsIndexes qb_indexPathsFromIndexesWithSection:0]]; }
Chris
I created a pull request with the fix. Reopening the issue.