I have a UIView (menuView in the code below) of size 320x218 inside the view. I want to load the navigation controller into this view. Im using the following code to do this:
MenuViewController *menuController = [[MenuViewController alloc] initWithNibName:@"MenuViewController" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:menuController];
navigationController.navigationBarHidden = YES;
[menuView addSubview:navigationController.view];
[menuController release];
[navigationController release];
When I execute it, the root view is not displayed in this view. Only the navigation bar is displayed, and the rest of the image is empty.
Edit:
I just put NSLog () in initWithNibName: and viewDidLoad: from MenuViewController. One in initWithNibName: is called, but one in viewDidLoad: is not: S
Update:
I tried to click menuControlleron my thinking navigationController, as it does not appear, perhaps it is not on the stack. An exception:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing the same view controller instance more than once is not supported