Created
February 9, 2011 08:59
-
-
Save hanksudo/818173 to your computer and use it in GitHub Desktop.
Retry Alert form, need to set UIAlertViewDelegate protocols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)handleError:(NSError *)error { | |
NSString *errorMessage = [error localizedDescription]; | |
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error Message" | |
message:errorMessage | |
delegate:self | |
cancelButtonTitle:@"Cancel" | |
otherButtonTitles:@"Retry", nil]; | |
[alertView show]; | |
[alertView release]; | |
} | |
// Handle alert form click event | |
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { | |
switch (buttonIndex) { | |
case 0: | |
NSLog(@"%@", @"Button Cancel Pressed"); | |
break; | |
case 1: | |
NSLog(@"%@", @"Button Retry Pressed"); | |
break; | |
default: | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment