Note that there are some explanatory texts on larger screens.

plurals
  1. POInserting alert view but not functioning
    primarykey
    data
    text
    <p>I have a situation where i need to alert users that the next view controller accessed is "Data Loading".</p> <p>I added this to the FirstViewController button action:</p> <pre><code>- (IBAction)showCurl:(id)sender { UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Please Wait" message:@"Acquiring data from server" delegate:self cancelButtonTitle:@"OK!" otherButtonTitles:nil]; [alert show]; SecondViewController *sampleView = [[SecondViewController alloc] init]; [sampleView setModalTransitionStyle:UIModalTransitionStylePartialCurl]; [self presentModalViewController:sampleView animated:YES]; } </code></pre> <p>it doesn't work. It loads to SecondViewController and only pops up after the SecondViewController is loaded.</p> <p>So i tried on the SecondViewController itself. The SecondViewController extracts data from a remote server which is the reason its going to take a while to download depending on Internet connectivity. So i decided to add the UIAlertView in the function:</p> <pre><code>- (NSMutableArray*)qBlock{ UIAlertView *alert_initial = [[UIAlertView alloc]initWithTitle:@"Loading" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert_initial show]; NSURL *url = [NSURL URLWithString:@"http://www.somelink.php"]; NSError *error; NSStringEncoding encoding; NSString *response = [[NSString alloc] initWithContentsOfURL:url usedEncoding:&amp;encoding error:&amp;error]; if (response) { const char *convert = [response UTF8String]; NSString *responseString = [NSString stringWithUTF8String:convert]; NSMutableArray *sample = [responseString JSONValue]; return sample; } else { UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"ALERT" message:@"Internet Connection cannot be established." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; } return NULL; } </code></pre> <p>This doesn't work too. And to top it off, i tried to off internet connection to see if the second alert pops up to alert user that there's no internet connection. The second alert doesn't work too.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload