如何使用AssetLibrary url进行映像?

时间:2013-03-22 07:09:48

标签: iphone ios xcode

我正在使用使用AssetLibrary的AGImagePickerController,当选择图像时,它会返回包含图像URL的NSArray。

我的问题是如何使用Array来检索图像?

NSLog显示返回数组的内容如下

(
"ALAsset - Type:Photo, URLs:assets-library://asset/asset.JPG?id=6D1AAC7F-3580-418E-AE87-8A5C83F76EAD&ext=JPG",
"ALAsset - Type:Photo, URLs:assets-library://asset/asset.JPG?id=1322E0E0-46CD-44DF-A736-FF812694B40C&ext=JPG"

我是否需要根据“ - ”针爆炸每个数组索引?

非常感谢任何帮助

1 个答案:

答案 0 :(得分:3)

刚刚解决了问题。为了别人的缘故,我就是这样做的

for (i = 0; i < info.count; i++) {
     ALAssetRepresentation *rep = [[info objectAtIndex: i] defaultRepresentation];
     UIImage * image  = [UIImage imageWithCGImage:[rep fullResolutionImage]];
}

来源:Determine selected photos in AGImagePickerController

相关问题