Wednesday, January 06, 2010

Handling Errors on the iPhone

I read that you need to have a popup error if your application can't get to a network and it's required, so I did some quick checking on how to do that and here is the code I found. Very simple to use and modify to add specific errors. Just place this into a function and call it, or put it right into your code where an error occurs.

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"

message:@"This is the error or get a string"

delegate:nil

cancelButtonTitle:@"OK"

otherButtonTitles: nil];

[alert show];

[alert release];


No comments: