Thank you all!
I just continued trying and found out the following: 1) I created a InfoPlist.strings resource file in the Content/Resources directory of my bundle 2) I stored my resources to this file 3) I've used CFBundleCopyLocalizedString(CFBundleGetMainBundle(), CFSTR("TEST"), CFSTR(""), CFSTR("InfoPlist"));" For whatever reason this now allows me to read my resources.
I'm just puzzled and more confused then before: 1) Can I only use this name as a filename for string resources 2) Does it have to be in the Content/Resources root directory? 3) Should not be the default a Localizable.strings file? 4) Is there no way to trace/debug what CFBundleCopyLocalizedString is actually doing and why it fails? 5) Is there a low level function that can be used instead of CFBundleCopyLocalizedString?
I btw. check the resource file before each test using the plutil command line tool and the file is always reported as OK.
Any help is appreciated!
-Dieter
On 07.10.2009, at 16:41, Glenn L. Austin wrote: On Oct 7, 2009, at 7:35 AM, Dieter Oberkofler wrote: The problem is that IÄm unable to retrieve (locate) the string resource file always just get the default value.
I'm aware of the fact that when using NULL or an empty default string it returns the key but the problem is that I never actually get the value in the file and can't figure out why.
Well, by default, strings should be in (at least) the Resources folder. If you want to use localized versions, then put them into the appropriate localized name. Xcode should pretty much do this automatically for you. plutil will tell you if your strings file is correct -- which, by the way, if you're using the "string" = "string"; format, the file should be using UTF-16 encoding. -- Glenn L. Austin, Computer Wizard and Race Car Driver <>< < http://www.austin-soft.com>
|