在 MyMainViewController 中,我展示了一个这样的导航 Controller :
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil];
UINavigationController* nc = [storyboard instantiateViewControllerWithIdentifier:@"NAVIGATION_CONTROLLER_ID"];
[self presentViewController:nc animated:YES completion:nil];
稍后,我需要从 UINavigationController 的 View 层次结构中的某处返回到 MyMainViewController。我该怎么做?
(注意:MyMainViewController 是在 .XIB 中定义的,而不是在定义 UINavigationController 及其子级的 Storyboard中。)
最佳答案
听起来您已经模态呈现了一个您想要删除的 NavController。模态呈现的 VC 可以自行移除。
在 NavController 的某处添加:
[self dismissViewControllerAnimated:YES completion:^{
NSLog(@"Dismissed nav controller modally");
}]
关于ios - 需要从呈现的 UINavigationController 中返回到呈现的 UIViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23658896/