我已经完成了一些研究并阅读了我在此处找到的其他答案,但没有找到任何实际可行的答案。我有一个应用程序,当发布内容时,我想转到帖子,如果在查看帖子时按下后退按钮,它应该返回两个视图,基本上跳过撰写视图。在显示另一个模式后关闭一个模式视图控制器
下面是我做过尝试,但它给
警告:试图提出有关谁的观点是不是在窗口层次!
-(IBAction)post{
[[self presentingViewController] dismissModalViewControllerAnimated:NO];
}
-(void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
ViewPostViewController *dvController = [[ViewPostViewController alloc] initWithNibName:@"ViewPostViewController" bundle:[NSBundle mainBundle]];
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:dvController];
nc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:nc animated:NO];
[nc release];
}
您在项目中使用导航控制器吗? – Zen