• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSUserInterfaceItemIdentification -identifier vs -tag
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUserInterfaceItemIdentification -identifier vs -tag


  • Subject: Re: NSUserInterfaceItemIdentification -identifier vs -tag
  • From: Lee Ann Rucker <email@hidden>
  • Date: Tue, 08 Oct 2013 13:54:55 -0700

On Oct 8, 2013, at 1:47 PM, email@hidden wrote:

> The NSControl -tag property can be used to identify an action sender.
>
> Can the NSUserInterfaceItemIdentification protocol property -identifier be safely used for the same purpose?

I don't know, but I'd prefer representedObject for something like that - it'll only be used by your code, so you don't have any restrictions to worry about.

>
> It was introduced to support window restoration.
>
> The docs apply several caveats with regard to the identifier:
> https://developer.apple.com/library/mac/documentation/cocoa/reference/NSUserInterfaceItemIdentification_Protocol/Introduction/Introduction.html
>
> From the above:
>
> You should not change the value of a window’s identifier after adding any views to the window. For views and controls in a window, the value you specify for this string must be unique on a per-window basis.
>
> The slash (/), backslash (\), or colon (:) characters are reserved and must not be used in your custom identifiers. Similarly, Apple reserves all identifiers beginning with an underscore (_) character. Applications and frameworks should use a consistent prefix for their identifiers to avoid collisions with other frameworks. For a list of prefixes used by the system frameworks, see “OS X Frameworks” in Mac Technology Overview.
>
> Jonathan
>


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSUserInterfaceItemIdentification -identifier vs -tag
      • From: "email@hidden" <email@hidden>
References: 
 >NSUserInterfaceItemIdentification -identifier vs -tag (From: "email@hidden" <email@hidden>)

  • Prev by Date: NSUserInterfaceItemIdentification -identifier vs -tag
  • Next by Date: Re: NSUserInterfaceItemIdentification -identifier vs -tag
  • Previous by thread: NSUserInterfaceItemIdentification -identifier vs -tag
  • Next by thread: Re: NSUserInterfaceItemIdentification -identifier vs -tag
  • Index(es):
    • Date
    • Thread