【发布时间】:2014-04-26 15:36:40
【问题描述】:
我知道还有一些其他类似的问题,但是我无法让它们中的任何一个起作用。我想我需要进一步澄清一下,我的攻击是正确的。
我有一个故事板,上面有一个 NavigationController 和一个包含 webview 的 ViewController。我已经成功捕获了对我的 webview 的点击,我希望它在一个新的 ViewController 中打开,该 ViewController 还包含一个 webview。我在情节提要上添加了第二个带有 webview 的 ViewController,但不知道如何向其中添加 segue。我还尝试通过将以下内容添加到我的第一个 ViewController 的 shouldStartLoadWithRequest 方法中来在代码中建立连接:
SecondViewController *secondViewController = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
[self presentViewController:secondViewController animated:YES completion:nil];
但是它永远不会打开我的第二个 ViewController,它只是停留在第一个 ViewController 中。我是菜鸟,我确定我在某个地方遗漏了什么?
【问题讨论】:
-
是的,通过“使用”我将它放在我的故事板上,连接到我的第一个视图控制器。
-
好的,你把这段代码放在某个按钮事件或其他地方吗?
标签: ios uiviewcontroller uinavigationcontroller storyboard