2

スマート アルバムのリストをアルファベット順に取得しようとしています。並べ替えてみましlocalizedTitletitleが、同じ結果が生成されます。

PHFetchOptions *options = [[PHFetchOptions alloc] init];
options.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"localizedTitle" ascending:YES]];

PHFetchResult *smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:options];

for (PHAssetCollection *collection in smartAlbums) {
    NSLog(@"PHAssetCollection: %@", collection.localizedTitle);
}

ログは、結果がソートされた順序で返されていないことを示しています。

2015-09-27 13:34:57.054 MyApp[2169:1043459] PHAssetCollection: Panoramas
2015-09-27 13:34:57.055 MyApp[2169:1043459] PHAssetCollection: All Photos
2015-09-27 13:34:57.055 MyApp[2169:1043459] PHAssetCollection: Hidden
2015-09-27 13:34:57.055 MyApp[2169:1043459] PHAssetCollection: Recently Deleted
2015-09-27 13:34:57.055 MyApp[2169:1043459] PHAssetCollection: Videos
2015-09-27 13:34:57.056 MyApp[2169:1043459] PHAssetCollection: Favorites
2015-09-27 13:34:57.056 MyApp[2169:1043459] PHAssetCollection: Slo-mo
2015-09-27 13:34:57.056 MyApp[2169:1043459] PHAssetCollection: Bursts
2015-09-27 13:34:57.056 MyApp[2169:1043459] PHAssetCollection: Time-lapse
2015-09-27 13:34:57.056 MyApp[2169:1043459] PHAssetCollection: Recently Added

私は何を間違っていますか?

4

0 に答える 0