Hello,
I have a button and when its clicked/tapped I want to check that a text box has a value. If no value is present I want an alert to pop up. The button loads a second ViewController which displays waypoints on a google map, if no option is in the text box the google maps ViewController will have problems loading the waypoints as it wont know which objects to request from the database.
I've been playing around with the code below:
-(IBAction)mapButton
{
if (route.text == NULL)
//if (route.text == [NSNull null])
//if ([route.text isEqual:[NSNull null]])
{
mapViewController .sharedMapID=mapID;
[self presentModalViewController:mapViewController animated:YES];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Please select a route !" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
}