在运行时在局部故事板之间切换

我有iPhone应用程序使用两种语言(阿拉伯语/英语)故事板​​如何我可以从阿拉伯语本地化故事板切换到英文故事板,而无需更改语言iPhone设置(在运行时)

我已经解决你可以做到这一点,如下面的代码:

UIStoryboard *storyBoard; if ([language isEqualToString:@"ar"]) { lan = [[NSLocale preferredLanguages] objectAtIndex:0]; storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone5Arabic" bundle:bnd]; } else if([language isEqualToString:@"en"]) { NSLog(@"DDD "); lan = [[NSLocale preferredLanguages] objectAtIndex:20]; storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone5English" bundle:bnd]; } NSBundle *bnd = [NSBundle bundleWithPath:[[NSBundle mainBundle]pathForResource:lan ofType:@"lproj" ]]; UIViewController *initViewController = [storyBoard instantiateInitialViewController]; [self.window setRootViewController:initViewController];