情节提要:按住 Control 键从一个条形按钮拖动到 Exit 项 [英] Storyboard: Control-drag from a bar button to the Exit item

查看:21
本文介绍了情节提要:按住 Control 键从一个条形按钮拖动到 Exit 项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在编写来自 Apple 的新教程(https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/SecondTutorial.html) 并且到了我遇到故事板问题的地步:

So I'm working on a new tutorial from Apple (https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/SecondTutorial.html) and got to a point where I'm having a problem with the storyboard:

我无法从 UIBarButton 按住 Control 拖动到场景停靠栏中的 Exit 项.当我点击退出项时,属性检查器会显示不适用".

I cannot Control-drag from a UIBarButton to the Exit item in the scene dock. When I click on the Exit item the Attributes inspector says "Not Applicable".

这是教程的摘录.我无法发布图片.为了更好地理解我的问题,您可以在页面底部看到按住 Control 拖动到退出项的图像.

Here is an extract of the tutorial. I am not able to post immages. For a better understanding of my problem you can see an image of the Control-drag to the Exit item at the bottom of the page.

回到 XYZToDoListViewController

[...]

要创建展开转场,请通过源视图控制器 XYZAddToDoItemViewController 停靠栏中的退出图标将取消和完成按钮链接到 unwindToList: 操作.

To create the unwind segue, link the Cancel and Done buttons to the unwindToList: action through the Exit icon in the dock of the source view controller, XYZAddToDoItemViewController.

将按钮链接到 unwindToList:操作

To link buttons to the unwindToList: action

  • 在项目导航器中,选择 Main.storyboard.
  • 在画布上,按住 Control 键从取消"按钮拖到添加待办事项场景停靠栏.
  • [...]
  • 在拖动结束的位置会出现一个菜单.选择 unwindToList:从快捷菜单.这是您刚刚添加到XYZToDoListViewController.m 文件.这意味着当取消点击按钮,segue 将展开,此方法将是"

推荐答案

只有当你有一个知道如何处理这些事件的方法时,你才能这样做.此方法必须具有以下签名结构:

You can only do this if you have a method that knows how to handle these events. This method has to have the following signature structure:

- (IBAction)finishedDoingWhatever:(UIStoryboardSegue *)sender;

请注意,它必须是一个 IBAction 并且它将 segue 作为参数.执行此操作后,退出图标应会显示弹出窗口.

Note that it has to be an IBAction and that it takes the segue as an argument. Once you do that, the popup should appear from the exit icon.

这篇关于情节提要:按住 Control 键从一个条形按钮拖动到 Exit 项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆