initWithNibName始终加载英文xib

时间:2009-10-09 22:00:25

标签: iphone localization uiviewcontroller

我有一个带有英语和本地化版本的本地化AboutApp.xib文件,但即使我将手机的语言设置为西班牙语,它也会加载英文版本。如何根据语言加载西班牙语版本?

// Make sure AboutApp View is allocated
if (self.aboutAppController == nil) {
    AboutApp* aboutApp =
        [[AboutApp alloc] initWithNibName:@"AboutApp" bundle:nil];
    self.aboutAppController = aboutApp;
    [aboutApp release];
}

[UIView beginAnimations: nil context: nil];
[UIView setAnimationDuration: 1.0f];
[UIView setAnimationTransition: UIViewAnimationTransitionCurlUp
                       forView: [self.view window] cache: YES];
[self presentModalViewController: self.aboutAppController animated: YES];
[UIView commitAnimations];

1 个答案:

答案 0 :(得分:3)

我找到了the answer on macrumors论坛。只需要进行Build Clean和重建,以识别xib的本地化。