What is the Label property under the identity inspector in Xcode 4?

14,928

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.

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.

Share:
14,928
Steve Moser
Author by

Steve Moser

iOS Developer @stevemoser https://twitter.com/stevemoser https://github.com/stevemoser SOreadytohelp SO has helped me become not only a better developer but also write good :)

Updated on June 28, 2022

Comments

  • Steve Moser
    Steve Moser almost 2 years

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

    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?