Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.8k views
Welcome To Ask or Share your Answers For Others

1 Answer

You need to subclass UINavigationController and override supportedInterfaceOrientations there.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...