我有这段代码用于检索图像并将其添加到数组中:
//Set the size of the video to 1280x720
CGSize targetSize = CGSizeMake(1280, 720);
PHImageRequestOptions *options = [[PHImageRequestOptions alloc]init];
options.synchronous = YES;
PHImageManager *manager = [[PHImageManager alloc]init];
for (PHAsset *asset in self.assetsToVideofy){
[manager requestImageForAsset:asset
targetSize:targetSize
contentMode:PHImageContentModeAspectFit
options:options
resultHandler:^(UIImage *result, NSDictionary *info) {
if (result) {
[self.photosToVideofy addObject:result];
}
}];
问题是图像仅作为缩略图添加。如何确保图像以 targetSize 加载然后添加到数组中?
谢谢