Re: What's the format of InfoPlist.strings?
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.