我得到了第一个没有导航 Controller 的ViewController
,我通过
ViewController
if (!self.mapViewController)
{
self.mapViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"MapViewController"];
}
[self presentViewController:self.mapViewController animated:YES completion:nil];
我使用 prepareForSegue
向其发送一些数据,但我需要它也与导航 Controller 一起使用。
我在 Storyboard中嵌入了导航 Controller ,但我的代码仍然调用第二个 ViewController
,但没有导航。
最佳答案
我不是 Storyboard的专业人士,但我相信 presentViewController
您应该使用以下函数来呈现基于 segues 的 Storyboard VC。
[self performSegueWithIdentifier:@"SegueIdentifierHere" sender:nil];
确保在你的 Storyboard中你也包含了一个 UINavigationControllerVC。
关于ios - 如何在我的情况下创建 ViewController? IOS 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21386456/