diff --git a/QBImagePicker/QBAssetsViewController.m b/QBImagePicker/QBAssetsViewController.m index 37381715..6bcfb36e 100644 --- a/QBImagePicker/QBAssetsViewController.m +++ b/QBImagePicker/QBAssetsViewController.m @@ -407,8 +407,11 @@ - (void)photoLibraryDidChange:(PHChange *)changeInstance NSIndexSet *changedIndexes = [collectionChanges changedIndexes]; if ([changedIndexes count]) { - [self.collectionView reloadItemsAtIndexPaths:[changedIndexes qb_indexPathsFromIndexesWithSection:0]]; - } + // We need to remove the removed images, since reloading them will cause a crash + // "uncaught ObjC exception, reason: attempt to delete and reload the same index path" + NSMutableIndexSet *changedWithoutRemovalsIndexes = [changedIndexes mutableCopy]; + [changedWithoutRemovalsIndexes removeIndexes:removedIndexes]; + [self.collectionView reloadItemsAtIndexPaths:[changedWithoutRemovalsIndexes qb_indexPathsFromIndexesWithSection:0]]; } completion:NULL]; }