Следующий код выделяет проблему в 3 простых шага:
1) ловить моменты
2) момент кеша localIdentifier
3) получить момент с идентификатором: сбой (на устройстве, 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 );
}
Я что-то неправильно понимаю? Вроде все просто...
Любая помощь приветствуется!