Created
June 7, 2011 23:43
-
-
Save jazztpt/1013469 to your computer and use it in GitHub Desktop.
Valentunes Xcode alert based on code
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) alertBasedOnCode:(int)errorCode message:(NSString*)message | |
{ | |
if (errorCode == 3) { | |
[self showAlertViewWithTitle:@"Authentication" message:message]; | |
LoginViewController* loginVC = [[[LoginViewController alloc] | |
initWithNibName:@"LoginViewController" bundle:nil] autorelease]; | |
[self.navigationController presentModalViewController:loginVC animated:YES]; | |
} | |
else if (errorCode == 12) { | |
[self showAlertViewWithTitle:@"Error" message:message]; | |
} | |
else { | |
NSLog(@"error from server: %d, %@", errorCode, message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment