I am trying to create a dialog box in my iOS app (app is a PhoneGap application).
I am using the code from this post: how to implement a pop up dialog box in iOS
Below is the code that is in the link
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No network connection"
message:@"You must be connected to the internet to use this app."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
I have put this code in AppDelegate.m
in the method
- (BOOL)application:(UIApplication)...
The app runs but the dialog box does not show up.
What is the problem?
I have updated the code as below
The code below is in my appdelegate.m
//reachability code
if (networkStatus == ReachableViaWifi)
{
while (true)
//show progress bar
}
else
{
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"title" message:@"message" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:@"cancel", nil];
[alert show];
}
The alert box is not showing up. What am I doing wrong?