• 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: What's the format of InfoPlist.strings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the format of InfoPlist.strings?


  • Subject: Re: What's the format of InfoPlist.strings?
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 24 Jul 2002 13:22:35 -0700

On Wednesday, July 24, 2002, at 01:01 PM, email@hidden wrote:

It's definitely not a plist format.

CFBundleName = "something";

is not a usual NSDictionary entry.

How can we get the string associated to the key CFBundleName without having to rewrite a complete parser?

It uses the strings-file format, which is a stripped-down version of the old plist format. Fortunately, the XML plist parser will also recognize strings-file format and the old plist format, so you don't need to do anything special. Conversely, .strings files such as InfoPlist.strings can use the XML plist format, although the strings-file format is usually more convenient.

Even more conveniently, you don't have to read InfoPlist.strings at all, because CFBundle and/or NSBundle will do it for you. If you're using CFBundle, the recommended approach is to use CFBundleGetValueForInfoDictionaryKey(). This will get a localized value from InfoPlist.strings, if there is one, or a non-localized value if not. If for some reason you must distinguish between localized and non-localized values, you can use CFBundleGetInfoDictionary() and CFBundleGetLocalInfoDictionary(). The corresponding NSBundle methods are objectForInfoDictionaryKey:, infoDictionary, and localizedInfoDictionary.

Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: What's the format of InfoPlist.strings?
      • From: email@hidden
References: 
 >What's the format of InfoPlist.strings? (From: email@hidden)

  • Prev by Date: alloc/init nested deep in long statement. okay or not?
  • Next by Date: Re: alloc/init nested deep in long statement. okay or not?
  • Previous by thread: What's the format of InfoPlist.strings?
  • Next by thread: Re: What's the format of InfoPlist.strings?
  • Index(es):
    • Date
    • Thread