![](/img/trans.png)
[英]What is the best practice to switch between view controllers for iOS in Objective-C
[英]Objective-C/Xcode - Switch between view controllers programatically?
如何以编程方式有效地在视图控制器之间切换? 我目前正在利用:
ViewController *viewController = [[ViewController alloc] init];
[self presentViewController:viewController animated:YES completion:nil];
但是,这不会显示我使用界面生成器插入的项目。 只有我以编程方式插入的项目。
我希望这样做,因为我想在每个页面上显示一个主页按钮。
在StoryBord中提供viewController身份
然后进入您的代码
UIViewController *documetController = [storyboard instantiateViewControllerWithIdentifier:@"MXDocumentViewController"];
[self.navigationController pushViewController:reviewListController animated:YES];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.