0
我使用iphone Main.storyboard
和第二一二故事板第一個是Main_iPad.storyboard
,我想爲iPad和iPhone我使用這個代碼分別致電:如何在iOS中調用不同的Storyboard?
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main_iPad" bundle:nil];
EABaseRootVC *loginController = [storyboard instantiateViewControllerWithIdentifier:@"root2"];
UINavigationController *navController=[[UINavigationController alloc]initWithRootViewController:loginController];
self.window.rootViewController=navController;
}
else
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
EABaseRootVC *loginController = [storyboard instantiateViewControllerWithIdentifier:@"root"];
UINavigationController *navController=[[UINavigationController alloc]initWithRootViewController:loginController];
self.window.rootViewController=navController;
}
但它始終顯示Main.storyboard iPhone資產。
我已經按照這個Different storyboards for iPhone and iPad in xcode 6
,如果您有任何其他想法,所以請給我建議。 我做錯了什麼?
我已經在我的Info.plist文件,但工作不添加這些東西。 – AforAmit
可能你已經在你的項目中更新了另一個plist文件,只需再次檢查它..這個代碼工作正常 – vaibhav
是的,我知道這段代碼工作正常,但不是在我的最後確定讓我檢查。 – AforAmit