Ios 从类似URL的资源库获取UIImage:/

Ios 从类似URL的资源库获取UIImage:/,ios,objective-c,image,ipad,alassetslibrary,Ios,Objective C,Image,Ipad,Alassetslibrary,我正在为iPad开发和安装iOS应用程序,我正在使用一个名为Grabkit的存储库,以便从Instagram和Flicker等不同的服务中获取图像,此外还可以从照相/摄像机中获取图像。问题是,当用户从roll中选择一张图片时,我会得到这样的URL:assets-library://asset/asset.JPG?id=DCFB9E49-93AA-49E3-89C8-2EE64AE2C4C6&ext=JPG 我尝试了一些代码从这种路径获取图像,但没有人成功,例如: ALAssetsLibrary

我正在为iPad开发和安装iOS应用程序,我正在使用一个名为Grabkit的存储库,以便从Instagram和Flicker等不同的服务中获取图像,此外还可以从照相/摄像机中获取图像。问题是,当用户从roll中选择一张图片时,我会得到这样的URL:assets-library://asset/asset.JPG?id=DCFB9E49-93AA-49E3-89C8-2EE64AE2C4C6&ext=JPG 我尝试了一些代码从这种路径获取图像,但没有人成功,例如:

 ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];

    // Ask for the "Asset" for the URL. An asset is a representation of an image in the Photo application.
    [library assetForURL:originalImage.URL
             resultBlock:^(ALAsset *asset) {

                 // Here, we have the asset, let's retrieve the image from it

                 CGImageRef imgRef = [[asset defaultRepresentation] fullResolutionImage];
                 /* Instead of the full res image, you can ask for an image that fits the screen
                  CGImageRef imgRef  = [[asset defaultRepresentation] fullScreenImage];
                  */

                 // From the CGImage, let's build an UIImage
               imatgetemporal = [UIImage imageWithCGImage:imgRef];


             } failureBlock:^(NSError *error) {

                 // Something wrong happened.

             }];

我的代码有问题吗?我必须尝试其他代码吗

这应该会有帮助,我也在使用Grabkit,我有一个类似的问题,正如您在这里看到的()。我也找到了@zimmryan建议的答案,但是没有用。嗨,请看这个链接,它可能会帮助你。。。这是