In my mainwindow.xib I have a navigationcontroller. On top of (as a sub item) I have another viewcontroller(homeviewcontroller).
In the nib I have set the window's rootviewcontroller to be this navigationcontroller.
This is deployed to the app store and works perfectly.
Since upgrading to ios6 sdk I am getting orientation issues - basically with this design the supportedInterfaceOrientations method of my homeviewcontroller does not get called when running my app in ios 6 device/simulator.
In order to fix this issue I need to set homeviewcontroller as the window's rootviewcontroller however this is not what I want - I need the navigationcontroller.
How do I get around this annoying bug in ios6?
Update:
I have also tried doing this programmatically - it still doesn't work.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
HomeViewController *homeVC = [[HomeViewController alloc]init];
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:homeVC];
[self.window setRootViewController:navController];
[self.window makeKeyAndVisible];
return YES;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…