My iphone application have a array for store the image path selected by user form gallery.
I want use ALAssetsLibrary to convert all image path in array to uiimage.
How can I do this action? I try used loop, but can not.
Thx for the help.
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) {
}];
Please use the below code
Note: Make sure that, your [filePath objectAtIndex:0] will be a
NSUrlobject. Please convert it toNSUrl, if not.Example: