I have the following code:
- (void)setupBook
{
if (self.bookNavigationController) {
BookViewController *bookVC = [[BookViewController alloc] initWithTemplate:x];
self.myBookVC = bookVC;
[bookVC release];
myBookVC.pageTitle = @"My Book";
UINavigationController *nController = [[UINavigationController alloc] initWithRootViewController:myBookVC];
self.bookNavigationController = nController;
[nController release];
}
}
and then in the other parts of the code I have:
[self.someOtherNavigationController pushViewController:self.bookVC];
however now when I try to present self.bookNavigationController as a modal view controller, it is as the myBookVC is not there. why is this? It just shows up an empty view with a navigation bar.
When to first create your view controller you are assigning it to a property, however when assign to as the nav controller’s rootViewController you are referencing an ivar. Use the property instead when assigning the rootViewController.