1

I'm tring to setup the title for my navigation controller to the text "Settings". I'm testing it in iOS 5.0 and it displays "Item" instead. If I specify any other dummy string (for the Settings key value in my resource bundle file for en) it is displayed correct.

[self setTitle:[NSString stringWithFormat:@"%@", NSLocalizedString(@"Settings", @"")]];

Settings is reserved and could not be specified as the title name for a navigation controller? I know I've tested on 3.X and was displayed.

4

3 回答 3

2

I'm guessing this has nothing to do with the title, but rather your localization. NSLocalizedString(@"Settings", @"") Tells the system to look up Settings, and if it can't find it in a en.lproj then it will put instead @"" as a result. My guess is your localization is incorrect. NSLocalizedString(@"Settings", @"Settings") probably would have worked for you, no?

于 2012-04-09T13:25:16.793 回答
0

use this...

self.navigationItem.title=  @"Some string";
于 2012-04-09T12:58:27.973 回答
0

Try out this code:

self.title=yourString;
于 2012-04-09T13:22:09.263 回答