小编use*_*536的帖子

如何使用ALAssetsLibrary将图像路径转换为uiimage

我的iphone应用程序有一个数组,用于存储用户表单库选择的图像路径.我想使用ALAssetsLibrary将数组中的所有图像路径转换为uiimage.我该怎么做?我尝试使用循环,但不能.谢谢你的帮助.

ALAssetsLibrary *library = [[[ALAssetsLibrary alloc] init] autorelease];
[library assetForURL:[filePath objectAtIndex:0] resultBlock:^(ALAsset *asset) {
    UIImage *image = [UIImage imageWithCGImage:[[asset defaultRepresentation] fullResolutionImage]];
    [fileImage addObject:image];
} failureBlock:^(NSError *error) {

}];
Run Code Online (Sandbox Code Playgroud)

iphone assets ios

2
推荐指数
1
解决办法
6685
查看次数

标签 统计

assets ×1

ios ×1

iphone ×1