Hello -

My code now for gathering images from the photo library seems to always timeout 
the library instance. 
How can I not? Nothing I have tried works.

I am using the ELCAlbumPickerController code which used to work great:

dispatch_async(dispatch_get_main_queue(), ^
    {
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        
        // Group enumerator Block
        void (^assetGroupEnumerator)( ALAssetsGroup *, BOOL *) = 
^(ALAssetsGroup *group, BOOL *stop) 
        {
            if (group == nil) 
            {
                return;
            }
            
            [self.assetGroups addObject:group];

            NSLog(@"count: %d", [group numberOfAssets]);

            // Reload albums
           [self performSelectorOnMainThread:@selector(reloadTableView) 
withObject:nil waitUntilDone:YES];

        };
        
        // Group Enumerator Failure Block
        void (^assetGroupEnumberatorFailure)(NSError *) = ^(NSError *error) {
            
            UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error" 
message:[NSString stringWithFormat:@"Album Error: %@", [error description]] 
delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
            [alert show];
            [alert release];
            
            NSLog(@"A problem occured %@", [error description]);                
                         
        };      
              
        
        
        NSMutableArray *tempArray = [[NSMutableArray alloc] init];
        self.assetGroups = tempArray;
        [tempArray release];
        
        
        // Enumerate Albums
        ALAssetsLibrary *library = [[ALAssetsLibrary alloc]init];        
        [library enumerateGroupsWithTypes:ALAssetsGroupAll
                               usingBlock:assetGroupEnumerator 
                             failureBlock:assetGroupEnumberatorFailure];
        
        
        [library release];
        [pool release];
    });    


Anyone get this working properly?
Thanks
james

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to