Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zeppenwolf

macrumors regular
Original poster
Nov 17, 2009
129
3
I'm probably missing something really silly, but why doesn't this work?

CFStringRef newname;
newname = CFCopyLocalizedString( CFSTR("CFBundleShortVersionString"),
CFSTR ("no comment") );

newname obtains the value "CFBundleShortVersionString", not "MyApp version blah"...

CFBundleShortVersionString is defined in the default InfoPlist.strings, of course, created by PB when the project was created, so I doubt that there can be a problem with the formatting in there, or invisible control characters, etc...

???
 
From the docs:
Searches the default strings file Localizable.strings for the string associated with the specified key.

If you want to get a localized string from a .strings file other than Localizable.strings, use CFCopyLocalizedStringFromTable.
 
Try one of the routines that starts with "CFBundle..."

Actually, I was using one. From CFBundle.h :

#define CFCopyLocalizedString(key, comment) \
CFBundleCopyLocalizedString(CFBundleGetMainBundle(), (key), (key), NULL)


But creating "Localizable.strings" gets it to work. Thanks!!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.