AlertView Problem in my first iPhone app

Discussion in 'iOS Development' started by stivi, Sep 30, 2008.

  1. stivi

    stivi New Member

    Sep 30, 2008
    Likes Received:
    Hi there

    I've just done my first iPhone app and it works quity good. But I have a problem which I don't know how to solve!

    My app makes two post requests on a website. The requests work fine. But after these requests, the app should show an alert view with the message that always went ok! But this alert view does not show up and the program crashes.

    All the other alert views work just fine! The Log-Entry "SMS gesendet!" works also correctly!

            if ([textRcv.text length] == 0)
    		NSLog(@"No receiver!");
    		[self showMsgBox:@"Kein Empfänger!"];
    	} else if ([textBox.text length] == 0) {
    		NSLog(@"No Text!");
    		[self showMsgBox:@"Kein Text!"];
    	} else if ([self sendSMS] == 0) {
    		NSLog(@"SMS gesendet!");
                    // HERE IS THE PROBLEM !!!!
    		[self showMsgBox:@"SMS erfolgreich verschickt!"];
    	} else {
    		[self showMsgBox:@"Es ist ein Fehler aufgetreten!"];
    I implement the showMsgBox function like this:

    - (void)showMsgBox:(NSString *)msg {
    	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Mitteilung!" message:msg delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    	[alert show];
    	[alert release];
    Has anybody a clue what the problem could be?

Share This Page