I've got a button on a view. When I click on it, it should load another view, one with a novigation controller. So far I've got this, the button calls this method:
-(IBAction)loadOptionsView:(id)sender {
if (self.optionsRootController == nil) {
//optionsRootController is declared as: UINavigationController *optionsRootController;
optionsRootController = [[UINavigationController alloc] init];
//Options is a UIViewController
Options *myOptions = [[Options alloc] initWithNibName:@"OptionsMenu" bundle:nil];
[optionsRootController pushViewController:myOptions animated:NO];
[myOptions release];
}
[self.view addSubview:optionsRootController.view];
}
What happens when I click the button is that it loads the xib file OptionsMenu on top of the current screen, but there's a gap at the top of the size of the status bar, so I can see the view below. Any help? What's the right method to load a new view that contains a navigation controller?
Thank you all!