iOS 6 UITabBarController supported orientation with current UINavigation controller

后端 未结 4 1263
长情又很酷
长情又很酷 2020-11-30 21:35

I have an iPhone app I am updating to iOS 6 that is having rotation issues. I have a UITabBarController with 16 UINavigationCotrollers. Most of the

4条回答
  •  有刺的猬
    2020-11-30 22:10

    I think is better something like that (as a category method)

    -(NSUInteger) supportedInterfaceOrientations {
        if([self.topViewController respondsToSelector:@selector(supportedInterfaceOrientations)])
        {
            return [self.topViewController supportedInterfaceOrientations];
        }
        return UIInterfaceOrientationMaskPortrait;
    }
    

    this ensures that the method is implemented. If you aren't doing this check and the method is not implemented (like in iOS5 env) the app should crash!

提交回复
热议问题