iOS从iCloud下载图像

时间:2017-09-29 15:19:30

标签: ios phasset

我这样写是为了选择照片。

- (void)assetsPickerController:(CTAssetsPickerController *)picker didFinishPickingAssets:(NSArray *)assets
{
    [picker dismissViewControllerAnimated:YES completion:nil];

    NSLog(@"videos %@",assets);

    for (PHAsset* asset in assets)
    {
        if (asset.mediaType == 2)
        {
            [self addVideoToMediaContainerWithAsset:asset];
        }
        else
        {

            PHImageManager *manager = [PHImageManager defaultManager];

            [manager requestImageForAsset:asset targetSize:PHImageManagerMaximumSize
                              contentMode:PHImageContentModeDefault
                                  options:self.requestOptions
                            resultHandler:^(UIImage *image, NSDictionary *info){

                                if (self.isToSelectSingleImage) {
                                self.mediaCollection = [NSMutableArray array];
                                self.thumbnailCollection = [NSMutableArray array];
                                }
                                [self addImageToMediaContainerWithImage:image.normalizedImage];
                            }];
        }

    }

}

但问题是,如果图像来自iCloud,它是零,当我输出信息时,我看到这样。

(lldb) po info {
    PHImageResultDeliveredImageFormatKey = 9999;
    PHImageResultIsDegradedKey = 0;
    PHImageResultIsInCloudKey = 1;
    PHImageResultIsPlaceholderKey = 0;
    PHImageResultWantedImageFormatKey = 9999; }

我在stackoverflow和github中找到了解决方案。但我不知道如何下载该图像。我该怎么办?

0 个答案:

没有答案