作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试创建一个按钮,当它收到“Touch Up Inside”电话时,将调用一个电话号码。但是,我在 ViewController.h 中声明的操作没有显示在我的 Connections Inspector 中,因此我无法将代码连接到我的按钮。在我的 ViewController.h 中,我编写了一行代码:
-(IBAction)makePhoneCall(id)sender;
我已经在我的 ViewController.m 中完成声明,但它仍然不会出现在我的 Connections Inspector 中。
如有任何帮助建议,我们将不胜感激。
最佳答案
您需要转到 Storyboard,单击最右侧的“实用程序”按钮。
从那里点击你的 Controller ;从左边数第三个选项卡,您将看到“自定义类”,您需要将名称更改为您在其中声明方法的类的名称。
看图:
从那时起,尝试使用连接检查器再次连接您的方法。
编辑:
在 Storyboard中添加用于选择 View Controller 的图片:
关于ios - 如何将按钮链接到 Xcode 6 中的操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26100882/
我正在开发一个 voip 调用应用程序。我需要做的是在接到来电时将 Activity 带到前台。我在应用程序中使用 Twilio,并在收到推送消息时开始调用。 问题是我试图在接到任何电话时显示 Act
我是一名优秀的程序员,十分优秀!