You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2019. It is now read-only.
Fatal Exception: NSInternalInconsistencyException
attempt to delete and reload the same index path (<NSIndexPath: 0xc000000000200016> {length = 2, path = 0 - 1})
code i used to fix (in - (void)photoLibraryDidChange:(PHChange *)changeInstance):
NSIndexSet *changedIndexes = [collectionChanges changedIndexes]; // make sure that a changed index hasn't been deleted in the meantime // (for example by a user deleting a photo in Photos app) NSMutableIndexSet *changedIndexes2 = [NSMutableIndexSet new]; [changedIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) { [removedIndexes enumerateIndexesUsingBlock:^(NSUInteger idx2, BOOL * _Nonnull stop2) { if (idx != idx2) { [changedIndexes2 addIndex:idx]; } }]; }]; if ([changedIndexes2 count]) { [collectionView reloadItemsAtIndexPaths:[changedIndexes2 aapl_indexPathsFromIndexesWithSection:0]]; }
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Error:
Fatal Exception: NSInternalInconsistencyException
attempt to delete and reload the same index path (<NSIndexPath: 0xc000000000200016> {length = 2, path = 0 - 1})
code i used to fix (in - (void)photoLibraryDidChange:(PHChange *)changeInstance):
NSIndexSet *changedIndexes = [collectionChanges changedIndexes]; // make sure that a changed index hasn't been deleted in the meantime // (for example by a user deleting a photo in Photos app) NSMutableIndexSet *changedIndexes2 = [NSMutableIndexSet new]; [changedIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) { [removedIndexes enumerateIndexesUsingBlock:^(NSUInteger idx2, BOOL * _Nonnull stop2) { if (idx != idx2) { [changedIndexes2 addIndex:idx]; } }]; }]; if ([changedIndexes2 count]) { [collectionView reloadItemsAtIndexPaths:[changedIndexes2 aapl_indexPathsFromIndexesWithSection:0]]; }
The text was updated successfully, but these errors were encountered: