如文档中所列,PHAsset 支持hidden (or isHidden)
获取密钥。但是,当我尝试获取隐藏资产时,我的应用程序因以下日志而崩溃:
*** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“获取选项中不支持的谓词:隐藏 == 1”
这是示例代码:
PHFetchOptions *options = [[PHFetchOptions alloc] init];
options.wantsIncrementalChangeDetails = YES;
options.includeAllBurstAssets = YES;
options.includeHiddenAssets = YES;
options.predicate = [NSPredicate predicateWithFormat:@"hidden = YES"];
PHFetchResult *fetchResult = [PHAsset fetchAssetsWithOptions:options];
return fetchResult;