另一个导航控制器上的流行导航控制器
问题描述:
要获得模态赛格上的导航控制器,我想我会尝试创建层次结构,如在屏幕截图中所示。另一个导航控制器上的流行导航控制器
此插座退出模式(登录信息视图控制器)的正确方法是什么?
我尝试了一些不同的东西:
- (IBAction)goBack:(id)sender
{
//none of these works.. (only tried one at a time..)
[self.navigationController removeFromParentViewController];
[self.navigationController popViewControllerAnimated:YES];
[self.navigationController.navigationController popViewControllerAnimated:YES];
}
答
在点你想关闭该模式的viewController,在类中使用这行:
[self dismissViewControllerAnimated:YES completion:^{
}];
因此,在你的情况下,它变成:
- (IBAction)goBack:(id)sender
{
[self dismissViewControllerAnimated:YES completion:^{
}];
}