gpt4 book ai didi

ios - NSPredicate 从 PHFetchResults 中排除慢动作视频

转载 作者:行者123 更新时间:2023-12-01 19:34:59 26 4
gpt4 key购买 nike

NSString *predicateFormat = [NSString stringWithFormat: @"mediaSubtype = %zd", PHAssetMediaSubtypeVideoHighFrameRate];
NSPredicate *predicate = [NSPredicate predicateWithFormat: predicateFormat];

PHFetchOptions *fetchOptions = [PHFetchOptions new];
fetchOptions.predicate = predicate;

PHFetchResult *userAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumVideos options:fetchOptions];

这是我的代码,用于获取不包括慢动作视频的视频。但我收到以下错误。即使我这样做也不起作用,

PHFetchOptions *fetchOptions = [PHFetchOptions new];
fetchOptions.predicate = [NSPredicate predicateWithFormat:@"(mediaSubtype & %d) == 0", PHAssetMediaSubtypeVideoHighFrameRate];

请有人帮忙。提前致谢。

Unsupported predicate in fetch options: mediaSubtype == 131072

最佳答案

swift 4

let assetFetchOptions = PHFetchOptions()
assetFetchOptions.predicate = NSPredicate(format: "NOT ((mediaSubtype & %d) != 0)", PHAssetMediaSubtype.videoHighFrameRate.rawValue)

关于ios - NSPredicate 从 PHFetchResults 中排除慢动作视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31939082/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com