• 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: variable indirection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variable indirection


  • Subject: Re: variable indirection
  • From: Alastair Houghton <email@hidden>
  • Date: Sun, 23 Dec 2007 14:07:51 +0000

On 22 Dec 2007, at 23:36, Paul Phillips wrote:

From interface builder, this works fine if I bind to the name of the
property: e.g. "First" for first name or "Last" for last. However, the
address book framework goes to some lengths to hide those string
literals, and only advertises string constants such as
kABFirstNameProperty and of course kABLastNameProperty. So I would like
to bind to those variable names as they are presumably more stable (and
perhaps more localizable.)

Those are keys, and therefore won’t be localized (you would never want to localize a key; you’d just make your application work badly whenever the user changed their language setting).


It’s very unlikely that Apple will ever change their values, which, although not documented, are likely to be encoded in data stored on disk or transmitted over the network.

If you’re really concerned, you could always use an NSDictionary to map from your own custom keys to the ones defined by the AddressBook framework. Personally I don’t think I’d bother, because the risk of these constants changing their values seems extremely small (though you’re right to consider the issue, because it certainly isn’t zero). Moreover, doing that won’t work for newly defined keys that your application doesn’t know yet (and I think the risk of that is much greater).

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

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


References: 
 >variable indirection (From: Paul Phillips <email@hidden>)

  • Prev by Date: Re: Trying to get my head around an NSGenericException/Apple Event error
  • Next by Date: Re: Using Bindings with C++ objects
  • Previous by thread: variable indirection
  • Next by thread: NSHTTPCookieStorage notification troubles
  • Index(es):
    • Date
    • Thread