Whenever I attempt to save an image to the Photo Library I get the following crash:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Asset (67) has too many at
tributes to treat as a single bitfield'
However, it doesn't happen immediately. It happens in a background thread after the image has already been saved.
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
[PHAssetChangeRequest creationRequestForAssetFromImage:image];
} completionHandler:^(BOOL success, NSError *error) {
if (error) {
NSLog(@"Error saving photo to camera roll: %@", error);
} else {
NSLog(@"Saved photo to camera roll");
}
}];
So I get a log of "Saved photo to camera roll" and then the app crashes. The exception always occurs in a background queue called "com.apple.photos.persistentHistoryChangeDistributor.managedObjectContext". And this happens 100% of the time I attempt to save an image but I can't reproduce this with another project.
Thoughts on why this might be occuring?