Pregunta

Fresh and green newbie here. I just started programming and already got stuck with UIAlert. I've searched on this site but there are so many postings and as I said I am kinda new to all this so I don't know what to really look for. This is what I have.

-(void)showError {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                message:@"Please try again later. Have a nice day."
                                               delegate:nil
                                      cancelButtonTitle:@"Dismiss"
                                      otherButtonTitles:nil];
}
¿Fue útil?

Solución 3

[alert show];

I always forget this too. Happy Coding.

Otros consejos

Need to do

[alert show];

to present

Code should be :

-(void)showError {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                message:@"Please try again later. Have a nice day."
                                               delegate:nil
                                      cancelButtonTitle:@"Dismiss"
                                      otherButtonTitles:nil];
[alert show];
[alert release];
}

-(void)showError {

   UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                  message:@"Please try again later. Have a nice day."
                                  delegate:nil
                                  cancelButtonTitle:@"Dismiss"
                                  otherButtonTitles:nil];

   [alert show];

}

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top