Photos Framework's PHChange changeDetailsForFetchResult produces incorrect indexes

Originator:jensen39
Number:rdar://18531985 Date Originated:10/2/2014
Status:Open Resolved:
Product:iOS SDK Product Version:8.0
Classification:Bug Reproducible:Always
 
Summary:
When using PhotoKit's [PHChange changeDetailsForFetchResult:] on a PHFetchRequest that is ordered by descending creationDate, deletedIndexes and changedIndexes overlap.

Steps to Reproduce:
1. Run the attached sample project (Example app using Photos framework)
2. Select the "All Photos" row.
3. Delete a photo or video from the device.
4. Notice the crash. 

Expected Results:
The PHFetchResultChangeDetails' changedIndexes do not overlap the deletedIndexes, preventing exceptions.

Actual Results:
The PHFetchResultChangeDetails' changedIndexes overlap the deletedIndexes, throwing an exception: 'NSInternalInconsistencyException', reason: 'attempt to delete and reload the same index path (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0})

Version:
iOS 8.0.2

Notes:
The attached sample app is Apple's "Example app using Photos framework"

The only change is that the creationDate sort order has been changed from ascending to descending.
 https://developer.apple.com/library/ios/samplecode/UsingPhotosFramework/Introduction/Intro.html#//apple_ref/doc/uid/TP40014575

Configuration:
iPhone 6+ AT&T

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!