Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8316161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:17:53+00:00 2026-06-08T21:17:53+00:00

My iphone application have a array for store the image path selected by user

  • 0

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) {

}];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:17:55+00:00Added an answer on June 8, 2026 at 9:17 pm

    Please use the below code

    typedef void (^ALAssetsLibraryAssetForURLResultBlock)(ALAsset *asset);
    typedef void (^ALAssetsLibraryAccessFailureBlock)(NSError *error);    
                           
    ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset){
                           
     ALAssetRepresentation *rep = [myasset defaultRepresentation];
     CGImageRef iref = [rep fullResolutionImage];
                
     if (iref){
    
             dispatch_async(dispatch_get_main_queue(), ^{
                 UIImage *myImage = [UIImage imageWithCGImage:iref scale:[rep scale] orientation:(UIImageOrientation)[rep orientation]];
                 [fileImage addObject:myImage];
                 //binding ur UI elements in main queue for fast execution
                 //self.imageView.image = myImage;
             });
    
                                    
             }      
    };      
                           
    ALAssetsLibraryAccessFailureBlock failureblock  = ^(NSError *myerror){
                           
         //failed to get image.
    };                          
                           
    ALAssetsLibrary* assetslibrary = [[[ALAssetsLibrary alloc] init] autorelease];
    [assetslibrary assetForURL:[filePath objectAtIndex:0] resultBlock:resultblock failureBlock:failureblock];
    

    Note: Make sure that, your [filePath objectAtIndex:0] will be a NSUrl object. Please convert it to NSUrl, if not.

    Example:

    ALAssetsLibrary* assetslibrary = [[[ALAssetsLibrary alloc] init] autorelease];
    
    NSURL myAssetUrl = [NSURL URLWithString:[filePath objectAtIndex:0]];
    
    assetslibrary assetForURL:myAssetUrl resultBlock:resultblock failureBlock:failureblock];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently in my iPhone application I have about 200 image views, and I will
I already have an iPhone application (version 1.0) available in the App Store and
I want reference of my address book in one of iPhone application. I have
I have an iPhone application that makes use of an API. Among the API
In my iPhone application I have a table view. When user taps any row,
Within my iPhone application I have a common tab bar with three tabs that
I'm developing an iPhone application that have a TabBarController with two tabs. Each tab
hai all, in my iphone application i have a login view with two text
i have developed an iphone application where i have generated a terms and condition
I'm developing an iPhone application where I have a bunch of images bundled with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.