Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling if user refused photo album access. #112

Open
johnqh opened this issue Mar 19, 2015 · 2 comments
Open

Handling if user refused photo album access. #112

johnqh opened this issue Mar 19, 2015 · 2 comments

Comments

@johnqh
Copy link

johnqh commented Mar 19, 2015

Right now, there is an error message which doesn't mean anything for ordinary user "Album Error: User denied access - (null)", and title is stuck with "Loading..."

Since the code is in viewDidLoad, it cannot be overwritten by subclassing.

It would be nice to have the failure block call a method which can be overwritten by subclassing.

@lengqingfeng
Copy link

how to this error for you

@johnqh
Copy link
Author

johnqh commented Apr 1, 2015

No need to do the error for me, just make it overwritable:

In viewDidLoad, change the assetGroupEnumberatorFailure block:

// Group Enumerator Failure Block
void (^assetGroupEnumberatorFailure)(NSError *) = ^(NSError *error) {

            [self onLoadError:error];
        };

then add a onLoadError: method

  • (void)onLoadError:(NSError *)error
    {
    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error" message:[NSString stringWithFormat:@"Album Error: %@ - %@", [error localizedDescription], [error localizedRecoverySuggestion]] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
    [alert show];

    NSLog(@"A problem occured %@", [error description]);

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants