Storyboard iOS5 - 如何防止按 Segue 按钮时改变 Storyboard

发布于 2025-01-05 16:58:42 字数 312 浏览 1 评论 0原文

我使用新的 iOS 5 实用程序应用程序模板创建了一个应用程序。自从以前的 SDK 以来,我们现在必须使用 GUI 的故事板(我确实喜欢使用),但我想知道如何防止“Segue”将视图翻转到故事板上的下一个视图。

默认情况下,有一个按钮,按下后会翻转到“FlipsideViewController”,我想使用此按钮作为登录表单的一部分,但我需要停止故事板进入 Segue,除非凭据正确。我已经写好了所有的登录代码,但无法阻止页面翻转。我认为可以做到这一点的方法实际上可以防止用户通过单击“FlipsideViewController”上的默认“完成”按钮返回。

有人可以帮忙吗?

I've created an app using the new iOS 5 Utility app template. Since the previous SDK, we now have to use storyboards for the GUI (which I do like using) but I am wondering how to prevent the "Segue" from flipping the view to the next view on the storyboard.

By default there is a button which when pressed flips to the "FlipsideViewController" and I would like to use this button as part of a login form but I need to stop the storyboard going to the Segue unless the credentials are correct. I have all my login code written but cannot prevent the page from flipping. The method I thought would do this actually prevents the user from going back by clicking the default "Done" button on the "FlipsideViewController".

Can anyone help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽心 2025-01-12 16:58:42

您必须将按钮连接到 IBAction 而不是 segue。在操作中,检查凭据是否正确,然后调用 performSegue: 来执行它。

您必须将 Segue 直接从视图控制器连接到下一个场景,而不是从按钮连接。

You have to connect the button to an IBAction instead of a segue. In the action, check if the credentials are correct, then call performSegue: to perform it.

You will have to connect the segue directly from the view controller to the next scene instead of from the button.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文