可能重复:
其视图不在窗口层次结构中
我的代码有问题。
我想去另一个视图控制器,所以这是我的代码:
- (void)reloadMyTB {
TestViewController *vc = [[TestViewController alloc] init];
UINavigationController *cntrol = [[UINavigationController alloc] initWithRootViewController:vc];
[self presentModalViewController:cntrol animated:NO];
[cntrol release];
}
但它不起作用,我可以在日志中阅读以下行:
Warning: Attempt to present <UINavigationController: 0x133db4b0> on <ArticleViewController: 0x13828330> whose view is not in the window hierarchy!
谢谢!