I used ELCImagePickerController in my app. but when we start our application first time and on Image gallery it will ask for accessing user location , if we don t allow to access user location to it then it will give error in UIAlertView and it wont show image gallery.
但此后,如果我们着手确定“ app”、地点服务、“gt”、[回头换到我们的用具进入地点],则开始使用“&”;去上“ery”一页,“并”;我们可以展示我们的图像。
So my question is how can we show image gallery with ELCImagePickerController with location services turn off for our app or user don t allow to access location to our app. ELCImagePickerController can be downloadable at this LINK
之后发现ESAlbumPicker Controller.m 案卷随后去Ge Did Load,从而在用户地点进入中断时造成错误警示。
dispatch_async(dispatch_get_main_queue(), ^
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Group enumerator Block
void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop)
{
if (group == nil)
{
return;
}
[self.assetGroups addObject:group];
// Keep this line! w/o it the asset count is broken for some reason. Makes no sense
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]);
};
// Enumerate Albums
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupAll
usingBlock:assetGroupEnumerator
failureBlock:assetGroupEnumberatorFailure];
[library release];
[pool release];
});