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

  • Home
  • SEARCH
  • 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 6069991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:52:58+00:00 2026-05-23T09:52:58+00:00

So, in init function I am getting images via AssetsLibrary //initWithNibName: photoArray = [[NSMutableArray

  • 0

So, in init function I am getting images via AssetsLibrary

//initWithNibName:

photoArray = [[NSMutableArray alloc ]init];
    ALAssetsLibrary *asset = [[ALAssetsLibrary alloc] init];
    void (^enumerateGroup)(ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop)
    {
        if (result != nil) {
            [photoArray addObject:result];
            NSLog(@"%@", result);
        }

    };
    void (^enumerationBlock)(ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop)
    {
        if (group != nil) {
            [group enumerateAssetsUsingBlock:enumerateGroup];
        }
    };
    [asset enumerateGroupsWithTypes:ALAssetsGroupAll 
                         usingBlock:enumerationBlock 
                       failureBlock:^(NSError *error) {NSLog(@"Something went wrong");}];
    [asset release];

//loadView

- (void)loadView
 {
UIView *view = [[UIView alloc ] init];
NSLog(@"%d", [photoArray count]);
self.view = view;
[view release];
}

Log from console:

2011-06-24 18:55:12.255 xxx[9450:207] 0 //

2011-06-24 18:55:12.306 xxx[9450:207] ALAsset – Type:Photo, URLs:{
“public.jpeg” = “assets-library://asset/asset.JPG?id=1000000001&ext=JPG”;

And I am confused. As you can see in the log, loadView executed code faster than initWithNibName. This is because getting images via AssetLibrary take some time. But I think all of this code is executing in one thread, so loadView should wait, for initWithNibName.

  • 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-23T09:52:59+00:00Added an answer on May 23, 2026 at 9:52 am

    The documentation for -enumerateGroupsWithTypes:... and -enumerateAssetsUsingBlock:... doesn’t say that those methods execute synchronously. From what you’ve found, it looks like they do their enumeration on a different thread so that you don’t have to wait.

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

Sidebar

Related Questions

I am getting H.264 images from an IP camera and want to save the
Dev-cpp comes with an example program Jackpot, which has a GetResults function in it:
/etc/init.d/* /etc/rc{1-5}.d/*
I have an init method that takes an (id) argument: -(id) initWithObject:(id) obj; I'm
I have several init.d scripts that I'm using to start some daemons. Most of
I understand that any init... method initializes a new object and that NSString stringWithString
I'm trying to use Ajax in CakePHP, and not really getting anywhere! I have
I'm trying to do a setTimeout where I pass variables to the function being
If all of my __init__.py files are empty, do I have to store them
I see __all__ in __init__.py files. What does it do?

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.