The following code highlights the issue in 3 simple steps:
1) fetch moments
2) cache moment localIdentifier
3) fetch moment with identifier : fail( on device, iOS 8.2 )
- ( void )momentLocalIdTest
{
PHFetchResult * fetchResult;
PHAssetCollection * moment;
NSString * localIdentifier;
fetchResult = [ PHAssetCollection fetchMomentsWithOptions: nil ];
if( fetchResult.count == 0 )
return;
moment = fetchResult.firstObject;
localIdentifier = moment.localIdentifier;
fetchResult = [ PHAssetCollection fetchAssetCollectionsWithLocalIdentifiers: @[ localIdentifier ] options: nil ];
if( fetchResult.count == 0 )
NSLog( @"AssetCollection with localIdentifier %@ not found!!!", localIdentifier );
}
Am I misunderstanding something? It seems pretty straightforward...
Any help appreciated!