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 7629893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:57:32+00:00 2026-05-31T05:57:32+00:00

Not sure if this is the right title for this question or not..anyways, I

  • 0

Not sure if this is the right title for this question or not..anyways,
I have an array of dictionaries and I am iterating through the dictionaries, passing in a block that gets executed sometimes in the future (asynchronous) and saving the result in a dictionary. Here’s my method:

- (void)elcImagePickerController:(ELCImagePickerController *)picker didFinishPickingMediaWithInfo:(NSArray *)info {

    NSLog(@"%@", info);
    NSMutableDictionary *images = [NSMutableDictionary dictionaryWithCapacity:[info count]];

    ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
    for (NSDictionary *dict in info) {
        NSURL *assetURL = [dict objectForKey:UIImagePickerControllerReferenceURL];

        [library assetForURL:assetURL
                 resultBlock:^(ALAsset *asset)  {
                     NSString *filename = asset.defaultRepresentation.filename;
                     UIImage *image = [dict objectForKey:UIImagePickerControllerOriginalImage];
                     [images setObject:filename forKey:image];
                 }
                failureBlock:^(NSError *error) {
                    [SVProgressHUD dismissWithError:@"Error occured."];
                }
         ];
    }

    NSLog(@"%@", images);

    [library autorelease];
    [self dismissImagePickerVC];
}

Ofcourse, at the end of this method, images is empty, but my question is, how can I get a call back when all the blocks for each iteration has been executed?
Thansk

  • 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-05-31T05:57:33+00:00Added an answer on May 31, 2026 at 5:57 am

    From Apple’s documentation:

    When the enumeration is done, enumerationBlock is invoked with group set to nil.

    When enumeration is done, your first block will see asset == nil.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im not sure if I'm doing this right. I have an action that I
I am not sure if I have set the right title for this post
Not sure if that the right title for the question, but what I'm trying
Not even sure if this is the right way to title the question. I
Not sure if this is the right forum for me to ask this question.
I'm not sure if this is the right place to post this question but
I'm not sure if this is the right place for this question, but here
I am not sure if this will be right place to ask the question,
Someone please recommend a better title for this question. I'm not sure what to
Not sure it is clear from this question title what I mean, so here

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.