I`m working on a project where an alert should pop up after returning from a controller with an empty value. It does pop up in the simulator, but on the iphone the app freeze and exit when returning from the controller. Any ideas?
Here is my code:
- (void)manualBarcodeViewControllerDidFinish:(ManualBarcodeViewController *)controller
{
......
......
else if([barcode isEqualToString:@""])
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"error" message:@"message" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"otherbutton"];
[alert show];
[alert release];
}
}
Your
otherButtonTitlesargument needs to be nil-terminated.In general, methods that take a variable number of arguments, need to have nil at the end. For example:
and in your case: