弹出导航控制器在另一个导航控制器

时间:2014-03-24 13:21:49

标签: ios iphone cocoa-touch

要在模态segue上获取导航控制器,我想我会尝试创建层次结构,如屏幕截图所示。

此插座退出模式的正确方法是什么(登录信息视图控制器)?

我尝试了一些不同的东西:

- (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];
}

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

在您要关闭模态viewController时,请在类中使用以下行:

[self dismissViewControllerAnimated:YES completion:^{
}];

所以,在你的情况下,它变成:

- (IBAction)goBack:(id)sender
{
    [self dismissViewControllerAnimated:YES completion:^{
    }];
}