Programmatically accessing Xcode specific label?

  • Is there any way to get, for an object instantiated via NIB file, the "Xcode Specific Label" set on it (if any)? This is the Label that can be set in IB under "Identity Inspector->Document->Label"

    --
    Rick
  • No there isn't - that's purely in Xcode/IB and isn't exported into the code at all.

    On 20 Aug, 2012, at 9:59 AM, Rick Mann <rmann...> wrote:

    > Is there any way to get, for an object instantiated via NIB file, the "Xcode Specific Label" set on it (if any)? This is the Label that can be set in IB under "Identity Inspector->Document->Label"
    >
    > --
    > Rick
    >
    >
    >
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Xcode-users mailing list      (<Xcode-users...>)
    > Help/Unsubscribe/Update your Subscription:
    > https://lists.apple.com/mailman/options/xcode-users/<rols...>
    >
    > This email sent to <rols...>
  • On 19 Aug 2012, at 8:59 PM, Rick Mann <rmann...> wrote:

    > Is there any way to get, for an object instantiated via NIB file, the "Xcode Specific Label" set on it (if any)? This is the Label that can be set in IB under "Identity Inspector->Document->Label"

    Nope. It's just a convenience for labeling things as you inspect them in the XIB/storyboard.

    You could define a string property in the object you're interested in, and use "User Defined Runtime Attributes," in the Identity inspector, to attach something you can read at runtime. For that matter, if it's a view, you can set the tag.

    — F

    --
    Fritz Anderson -- Xcode 4 Unleashed -- <http://x4u.manoverboard.org/>
  • And yet, when autolayout constraints log issues, they often (although not always, and hence my need) display the label you've given your view(s).

    --
    Rick

    On Aug 19, 2012, at 20:26 , Roland King <rols...> wrote:

    > No there isn't - that's purely in Xcode/IB and isn't exported into the code at all.
    >
    > On 20 Aug, 2012, at 9:59 AM, Rick Mann <rmann...> wrote:
    >
    >> Is there any way to get, for an object instantiated via NIB file, the "Xcode Specific Label" set on it (if any)? This is the Label that can be set in IB under "Identity Inspector->Document->Label"
    >>
    >> --
    >> Rick
    >>
    >>
    >>
    >>
    >> _______________________________________________
    >> Do not post admin requests to the list. They will be ignored.
    >> Xcode-users mailing list      (<Xcode-users...>)
    >> Help/Unsubscribe/Update your Subscription:
    >> https://lists.apple.com/mailman/options/xcode-users/<rols...>
    >>
    >> This email sent to <rols...>
    >
  • The identifier string is accessible, if not already in use by your code.

    ~ Erik

    On 2012-08-19, at 9:14 PM, Rick Mann <rmann...> wrote:

    > And yet, when autolayout constraints log issues, they often (although not always, and hence my need) display the label you've given your view(s).
    >
    > --
    > Rick
    >
    >
    >
    > On Aug 19, 2012, at 20:26 , Roland King <rols...> wrote:
    >
    >> No there isn't - that's purely in Xcode/IB and isn't exported into the code at all.
    >>
    >> On 20 Aug, 2012, at 9:59 AM, Rick Mann <rmann...> wrote:
    >>
    >>> Is there any way to get, for an object instantiated via NIB file, the "Xcode Specific Label" set on it (if any)? This is the Label that can be set in IB under "Identity Inspector->Document->Label"
    >>>
    >>> --
    >>> Rick
    >>>
    >>>
    >>>
    >>>
    >>> _______________________________________________
    >>> Do not post admin requests to the list. They will be ignored.
    >>> Xcode-users mailing list      (<Xcode-users...>)
    >>> Help/Unsubscribe/Update your Subscription:
    >>> https://lists.apple.com/mailman/options/xcode-users/<rols...>
    >>>
    >>> This email sent to <rols...>
    >>
    >
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Xcode-users mailing list      (<Xcode-users...>)
    > Help/Unsubscribe/Update your Subscription:
    > https://lists.apple.com/mailman/options/xcode-users/<erik.stainsby...>
    sky.ca

    >
    > This email sent to <erik.stainsby...>
  • On Aug 19, 2012, at 21:26 , Erik Stainsby <erik.stainsby...> wrote:

    > The identifier string is accessible, if not already in use by your code.

    Can you elaborate?

    --
    Rick
  • I just compiled up an iOS application and a test OSX one, the former of course with no constraints, the latter with them, and set the Xcode specific label for one view to something with the word banana in it. Then I went to the built product directory and searched for banana, didn't find it in any file in the built product.  It's in the uncompiled xib, but I can't locate it anywhere in the build, it certainly doesn't seem to be in the compiled nib which is where I might have expected it.

    So I don't know how autolayout's finding them. I've hunted for this before and came up with the same result.

    On 20 Aug, 2012, at 12:14 PM, Rick Mann <rmann...> wrote:

    > And yet, when autolayout constraints log issues, they often (although not always, and hence my need) display the label you've given your view(s).
    >
    > --
    > Rick
    >
    >
    >
    > On Aug 19, 2012, at 20:26 , Roland King <rols...> wrote:
    >
    >> No there isn't - that's purely in Xcode/IB and isn't exported into the code at all.
    >>
    >> On 20 Aug, 2012, at 9:59 AM, Rick Mann <rmann...> wrote:
    >>
    >>> Is there any way to get, for an object instantiated via NIB file, the "Xcode Specific Label" set on it (if any)? This is the Label that can be set in IB under "Identity Inspector->Document->Label"
    >>>
    >>> --
    >>> Rick
    >>>
    >>>
    >>>
    >>>
    >>> _______________________________________________
    >>> Do not post admin requests to the list. They will be ignored.
    >>> Xcode-users mailing list      (<Xcode-users...>)
    >>> Help/Unsubscribe/Update your Subscription:
    >>> https://lists.apple.com/mailman/options/xcode-users/<rols...>
    >>>
    >>> This email sent to <rols...>
    >>
    >
  • On Aug 20, 2012, at 0:37 , Roland King <rols...> wrote:

    > I just compiled up an iOS application and a test OSX one, the former of course with no constraints, the latter with them, and set the Xcode specific label for one view to something with the word banana in it. Then I went to the built product directory and searched for banana, didn't find it in any file in the built product.  It's in the uncompiled xib, but I can't locate it anywhere in the build, it certainly doesn't seem to be in the compiled nib which is where I might have expected it.

    Clever experiment. I wonder how it's doing it!

    --
    Rick
  • Well, how do you already access those items in that nib from your code?

    I seem to remember that certain items for the UI Items may be exposed, like tab.text or something like that.

    On Aug 20, 2012, at 3:21 AM, Rick Mann wrote:

    >
    > On Aug 19, 2012, at 21:26 , Erik Stainsby <erik.stainsby...> wrote:
    >
    >> The identifier string is accessible, if not already in use by your code.
    >
    > Can you elaborate?
    >
    > --
    > Rick
    >
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Xcode-users mailing list      (<Xcode-users...>)
    > Help/Unsubscribe/Update your Subscription:
    > https://lists.apple.com/mailman/options/xcode-users/<zav...>
    >
    > This email sent to <zav...>
  • I'm not sure why people can just write the answer.

    My code does not use any identifier string. If it did, I wouldn't be asking how to get it.

    If it's accessible, please tell me how.

    --
    Rick

    On Aug 20, 2012, at 2:33 , Alex Zavatone <zav...> wrote:

    > Well, how do you already access those items in that nib from your code?
    >
    > I seem to remember that certain items for the UI Items may be exposed, like tab.text or something like that.
    >
    >
    > On Aug 20, 2012, at 3:21 AM, Rick Mann wrote:
    >
    >>
    >> On Aug 19, 2012, at 21:26 , Erik Stainsby <erik.stainsby...> wrote:
    >>
    >>> The identifier string is accessible, if not already in use by your code.
    >>
    >> Can you elaborate?
    >>
    >> --
    >> Rick
    >>
    >>
    >> _______________________________________________
    >> Do not post admin requests to the list. They will be ignored.
    >> Xcode-users mailing list      (<Xcode-users...>)
    >> Help/Unsubscribe/Update your Subscription:
    >> https://lists.apple.com/mailman/options/xcode-users/<zav...>
    >>
    >> This email sent to <zav...>
    >

    --
    Rick
  • Thanks to Eric Stainsby, the thing to do is set the "Identifier" in IB, and use the -identifier property (from the NSUserInterfaceItemIdentification protocol).

    New in 10.7.

    --
    Rick

    On Aug 20, 2012, at 13:42 , Rick Mann <rmann...> wrote:

    > I'm not sure why people can just write the answer.
    >
    > My code does not use any identifier string. If it did, I wouldn't be asking how to get it.
    >
    > If it's accessible, please tell me how.
    >
    > --
    > Rick
    >
    > On Aug 20, 2012, at 2:33 , Alex Zavatone <zav...> wrote:
    >
    >> Well, how do you already access those items in that nib from your code?
    >>
    >> I seem to remember that certain items for the UI Items may be exposed, like tab.text or something like that.
    >>
    >>
    >> On Aug 20, 2012, at 3:21 AM, Rick Mann wrote:
    >>
    >>>
    >>> On Aug 19, 2012, at 21:26 , Erik Stainsby <erik.stainsby...> wrote:
    >>>
    >>>> The identifier string is accessible, if not already in use by your code.
    >>>
    >>> Can you elaborate?
    >>>
    >>> --
    >>> Rick
    >>>
    >>>
    >>> _______________________________________________
    >>> Do not post admin requests to the list. They will be ignored.
    >>> Xcode-users mailing list      (<Xcode-users...>)
    >>> Help/Unsubscribe/Update your Subscription:
    >>> https://lists.apple.com/mailman/options/xcode-users/<zav...>
    >>>
    >>> This email sent to <zav...>
    >>
    >
    >
    > --
    > Rick
    >
    >
    >

    --
    Rick
previous month august 2012 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today