Xcode 4中的身份检查器下的Label属性是什么? [英] What is the Label property under the identity inspector in Xcode 4?

查看:73
本文介绍了Xcode 4中的身份检查器下的Label属性是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Label属性的占位符文本是'Xcode Specific Label',当用Google搜索时没有任何内容。

The place holder text for the Label property is 'Xcode Specific Label', which when googled turns up nothing.

我认为它用于识别UI元素你的代码是'Xcode Specific Label',而不是按钮在UI中显示的实际文本。如果是这样,我有兴趣在我的代码中使用它,因为我有类似功能的按钮,我想要发送到同一方法的动作,并通过名称区分发送者属性。我知道你可以通过对象id来做到这一点,但我认为使用名称会更清楚。我该怎么做?

I assumed it used for identifying the UI element in your code by it's 'Xcode Specific Label' and not the actual text that the button displays in the UI. If so I am interesting in using it in my code since I have buttons with similar functions whose actions I want to send to the same method and differentiate between the two with the sender property by name. I understand that you can do this through the object id but I think that using a name would be clearer. How would I do this?

推荐答案

Label字段标识Xcode中的UI元素。如果使用Label文本字段命名UI元素,您会注意到元素的名称在对象列表中更改,该列表位于画布的左侧。

The Label field identifies the UI element in Xcode. If you name the UI element using the Label text field, you'll notice that element's name changes in the object list, which is to the left of the canvas.

标签字段对代码没有太大作用。它的存在是为了在Xcode中使事情更方便。事实上,身份检查器的整个身份部分的存在是为了让您在Xcode中更方便。假设您的窗口中有三个文本字段。为每个文本字段提供不同的标签可以更容易地识别每个文本字段。

The Label field doesn't do much with regard to code. It exists to make things more convenient in Xcode. In fact, the whole Identity section of the identity inspector exists to make things more convenient for you in Xcode. Suppose you have three text fields in your window. Giving each text field a different label makes it easier to identify each text field.

这篇关于Xcode 4中的身份检查器下的Label属性是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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