NSAlert pops up for 3 times

Posted by Marco on Stack Overflow See other posts from Stack Overflow or by Marco
Published on 2010-03-15T08:30:37Z Indexed on 2010/03/15 8:39 UTC
Read the original article Hit count: 346

Hello community i have a big problem.

i implemented an NSAlert in the viewDidLoad() of my app:

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

But the Alert pops up for 3 times, and then i can klick on it. Could it be that the viewDidLoad() starts for 3 times?

This is the viewDidLoad in the rootViewController, that manages the views:

- (void)viewDidLoad {
    Kundenkarte *kartenAnsicht = [[Kundenkarte alloc]
                                                initWithNibName:@"Kundenkarte" bundle:nil];
    kartenAnsicht.rootViewController = self;
    kartenAnsicht.viewDidLoad;
    self.map = kartenAnsicht;


    [self.view addSubview:kartenAnsicht.view];


    [kartenAnsicht release];
//  [super viewDidLoad];

}

kartenAnsicht is the view where the problem is.

I hope someone could help me because my ideas are over!

© Stack Overflow or respective owner

Related posts about viewdidload

Related posts about uiviewcontroller