简体   繁体   English

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

[英]Pop navigation controller on another navigation controller

To get a Navigation Controller on a modal segue I figured I'd try to create the hierarchy as you can see in the screenshot. 我想在模态搜索中获取导航控制器,我试图创建该层次结构,如屏幕截图所示。

What is the right way in this outlet to exit the modal (Login Info View Controller)? 在此出口中退出模态(登录信息视图控制器)的正确方法是什么?

I tried some different stuff: 我尝试了一些不同的东西:

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

在此处输入图片说明

在此处输入图片说明

At the point you want to dismiss the modal viewController, use this line within the class: 在您要关闭模态viewController的那一点上,在类中使用此行:

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

So, in your case, it becomes: 因此,在您的情况下,它变为:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM