Created
February 27, 2014 15:27
-
-
Save samrayner/9252281 to your computer and use it in GitHub Desktop.
This file contains hidden or 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)displayError:(NSError *)error | |
| { | |
| [self displayAlertWithTitle:@"Error" message:[error description]]; | |
| } | |
| - (void)displayAlertWithTitle:(NSString *)title message:(NSString *)message | |
| { | |
| UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title | |
| message:message | |
| delegate:nil | |
| cancelButtonTitle:@"OK" | |
| otherButtonTitles:nil]; | |
| [alertView show]; | |
| } | |
| - (void)displayPromptWithTitle:(NSString *)title message:(NSString *)message placeholder:(NSString *)placeholder | |
| { | |
| UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title | |
| message:message | |
| delegate:self | |
| cancelButtonTitle:@"Cancel" | |
| otherButtonTitles:@"OK", nil]; | |
| alertView.alertViewStyle = UIAlertViewStylePlainTextInput; | |
| [alertView textFieldAtIndex:0].text = placeholder; | |
| [alertView show]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment