How to lock orientation in UINavigationControllers
问题 As the ShouldAutorotateToInterfaceOrientation is deprecated in iOS 6 I am not able to lock the orientation in my app. In my app I have UINavigationControllers with multiple views, some views need to support both portrait and landscape, while other views need to support portrait only. How can I over come this problem please suggest me some idea. Thanks 回答1: Use this function only work in iOS 6 -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } -