UINavigationController UIBarButtonItem 推送 Segue
当我查看 UIBarButtonItem 并从连接检查器拖动“推”segue 时,我可以将其连接到故事板中的另一个视图控制器。当我运行它并单击 UIBarButtonItem 时,我在 IB 中连接的 ViewController 会神奇地出现。
我的问题是:这发生在哪里?这就是“推”事件。父 ViewController 中有方法吗?类似:“PushSegue”?我想将信息从导航视图控制器传递到连接的 ViewController。例如,如果我想在那一刻弹出一个 UIAlertView,我会在哪里做呢? ViewController 类中的某个位置?
When I view a UIBarButtonItem and drag from Connections Inspector the "push" segue, I can connect it to another view controller in the storyboard. When I run it and click the UIBarButtonItem the ViewController I connected up in IB magically appears.
My question is: where does this happen? This, "push" event. Is there a method in a parent ViewController? Something like: "PushSegue"? I'd like to pass information to the connected ViewController from the navigation view controller. For example, if I wanted to popup a UIAlertView at that moment, where would I do that? Somewhere in the ViewController class?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一旦调用了segue(通过按下按钮),它就会调用prepareForSegue。
在prepareForSegue中,您检查调用了哪个segue,然后可以运行您想要准备下一个视图控制器的任何代码。
Once a segue has been called (by pressing the button) it calls prepareForSegue.
In prepareForSegue you check which segue was called and then can run any code you want to prepare the next view controller.