ALAssetsLibrary and iOS5
ALAssetsLibrary and iOS5
- Subject: ALAssetsLibrary and iOS5
- From: James Cicenia <email@hidden>
- Date: Thu, 27 Oct 2011 11:36:16 -0500
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 (email@hidden)
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:
This email sent to email@hidden