如何在Xcode 4.3.1中为类添加操作或插座? [英] How do I add an action or outlet to a class in Xcode 4.3.1?

查看:129
本文介绍了如何在Xcode 4.3.1中为类添加操作或插座?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从cocoalab.com追踪了一个略微过时的指南(成为Xcoder

I'm following a slightly outdated the guide from cocoalab.com (Become An Xcoder) to learn the basics of cocoa, but I'm stuck on one of the instructions.

在第45页(第8节:9)的创建连接一节中,我将介绍可可的基本知识。 ,它告诉我选择我的新类的实例,并从身份检查员添加两个操作和一个插座。

On page 45 (section 08:9) in the section titled "Creating connections", it tells me to select the instance of my new class, and from the identity inspector, to add two actions and an outlet.

我使用Xcode 4.3.1这显然是有点不同的版本,本教程是写的,但我不知道如何做等效的在这个较新的版本。

I'm using Xcode 4.3.1 which is obviously a bit different to the version that this tutorial was written for, but I can't figure out how to do the equivalent in this newer version.

任何人

推荐答案

请打开助理编辑器(屏幕截图中的红色矩形)。然后,从界面构建器,按 ctrl 键,将鼠标从按钮(或您视图中的其他控件)拖动到 .h 文件。

Open the Assistant Editor (red rectangle in the screenshot). Then, from Interface Builder, press the ctrl key and drag the mouse from the button (or an other control in you view) to the .h file.

系统会提示您选择要创建的连接类型,如下面的屏幕截图所示:

You will be prompted to choose the type of the connection to create as in the screenshot below:

>

这篇关于如何在Xcode 4.3.1中为类添加操作或插座?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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