Okay, I'm working on a iPhone game. You start off on a menu screen, then select "New Game" or "High Scores". Let's select "New Game."
The first time you do this, you get an alert telling you how to play the game. I implemented this with the - (id)initWithNibName function. Here is the exact code:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
//Alert Here
}
return self;
}
It works great. However, if I go back to the main menu, then return to the game screen, this alert does not pop up (it only pops up the first time the user clicks "New Game").
I am also using an viewDidLoad function, just as a side note.
Here is the code I am using to implement my nib (I believe):
[mainViewController viewWillAppear:YES];
[introViewController viewWillDisappear:YES];
[introView removeFromSuperview];
[self.view addSubview:mainView];
[self.view insertSubview:menuButton aboveSubview:mainViewController.view];
[introViewController viewDidDisappear:YES];
[mainViewController viewDidAppear:YES];
Once again, Many Thanks