Skip to content

Instantly share code, notes, and snippets.

@jazztpt
Created June 7, 2011 23:43
Show Gist options
  • Save jazztpt/1013469 to your computer and use it in GitHub Desktop.
Save jazztpt/1013469 to your computer and use it in GitHub Desktop.
Valentunes Xcode alert based on code
-(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