【发布时间】:2011-12-27 12:39:01
【问题描述】:
我有一个应用程序使该用户能够在运行时从应用程序切换语言,一切正常,但是当切换到另一种语言负载时,加载该语言的本地化 Xib,但此 Xib 中没有任何图像。在我的代码下方用于切换到另一种语言。
NSString* str = [[[NSUserDefaults standardUserDefaults]valueForKey:@"AppleLanguages"] objectAtIndex:0];
NSBundle* bnd = [NSBundle bundleWithPath:[[NSBundle mainBundle]pathForResource:str ofType:@"lproj" ]];
HomeViewController *homeVC = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:bnd];
UINavigationController *localNavigationController = [[UINavigationController alloc] initWithRootViewController:homeVC];
localNavigationController.viewControllers = [NSMutableArray arrayWithObject:homeVC];
localNavigationController.navigationBarHidden = YES;
NSMutableArray *navs = [NSMutableArray arrayWithObject: localNavigationController];
tabBarController.viewControllers = navs;
self.window.rootViewController = tabBarController;
这是Xcode调试中出现的错误
Could not load the "sahdow.png" image referenced from a nib in the bundle with identifier "(null)"
我很高兴能帮助我解决这个需要我花费数小时的问题。
【问题讨论】:
标签: iphone ios ios4 localization ios5