我有一个 iPad 应用程序(XCode 4.6、iOS 6.2、Storyboards 和 ARC)。我正在尝试本地化 UISegmentControl。我已经在 MainStoryboard.strings 文件中有翻译,并且在控制器的 viewDidLoad 中有这段代码:
// set titles of UISegmentedControls
NSString *resourcePath =[[NSBundle mainBundle] pathForResource:@"MainStoryboard" ofType:@"strings"];
NSDictionary *resourceDict = [NSDictionary dictionaryWithContentsOfFile:resourcePath];
[self.oDeleteOldAppts setTitle:[resourceDict objectForKey:@"jcy-vN-Nq9.segmentTitles[0]"] forSegmentAtIndex:0];
[self.oDeleteOldAppts setTitle:[resourceDict objectForKey:@"jcy-vN-Nq9.segmentTitles[1]"] forSegmentAtIndex:1];
[self.oDeleteOldAppts setTitle:[resourceDict objectForKey:@"jcy-vN-Nq9.segmentTitles[2]"] forSegmentAtIndex:2];
问题是resourcePath和resourceDict都是零。我如何为当前语言获取它们,无论是en还是其他语言?