views:

145

answers:

1

Hi all, preemptive sorry for the newbie question.

I'm trying to load strings from a resource file in an iPhone project (XCode, Objective C++). I've created a file called s.strings with the following content:

/* 
   s.strings
   Created by Seva on 11/22/09.
*/
"a"="b"

The file is in UTF-16, it's in the Resources folder in the project, XCode treats it as "text.plist.strings". There are no localizations to this file.

Then I'm trying to load that string on application start:

NSString *s = NSLocalizedStringFromTable(@"a", @"s", nil);

No matter what I do, the value of s is "a", as opposed to "b".

I must be missing something very basic - any ideas, please, what's wrong in this trivial example?

+2  A: 

Each statement in the strings file needs to be terminated with a semicolon (;).

MihaiD
Thanks, that was it.Hoping for a resource compilation error message was a vestige of prior Windows experience, I take it. Mac is far too user-friendly for such nastiness.
Seva Alekseyev
That's strange, I usually do get compilation errors if I miss a semicolon in the strings file.
MihaiD