要在模态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];
}
答案 0 :(得分:1)
在您要关闭模态viewController时,请在类中使用以下行:
[self dismissViewControllerAnimated:YES completion:^{
}];
所以,在你的情况下,它变成:
- (IBAction)goBack:(id)sender
{
[self dismissViewControllerAnimated:YES completion:^{
}];
}