iPhone: NSAlert Delegate Method Never Called

Posted by Marco on Stack Overflow See other posts from Stack Overflow or by Marco
Published on 2010-03-15T08:03:53Z Indexed on 2010/03/15 12:59 UTC
Read the original article Hit count: 413

Hello,

I have implemented an NSAlert but the delegate method didDissmissWithButton is never called.

This code evokes the NSAlert:

NSString *title = [NSString stringWithFormat:@"Keine Internetverbindung"];
        NSString *alertMessage = [NSString stringWithFormat:@"Es konnte keine Verbindung zu www.sip.de aufgebaut werden!"];
        NSString *ok = [NSString stringWithFormat:@"Ok"];               

        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:alertMessage  delegate:self cancelButtonTitle:ok otherButtonTitles:nil];

        [alert show];
        [alert release];

and this is the NSAlert delegate method:

- (void)alertView:(UIAlertView *)alertView didDisMissWithButtonIndex:(NSInteger)buttonIndex{
    exit(3);
}

The method is never called, what is my mistake?

© Stack Overflow or respective owner

Related posts about uialertview

Related posts about iphone-sdk