我有以下代码:
- (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];
}
}
然后在我拥有的代码的其他部分:
[self.someOtherNavigationController pushViewController:self.bookVC];
但是现在当我尝试将 self.bookNavigationController 呈现为模态视图控制器时,这是因为 myBookVC 不存在。为什么是这样?它只是显示一个带有导航栏的空视图。