I have several views in my application, some views should support both portrait and landscape, while other views should only support portrait. Thus, in the project summary, I chose all orientations.
The following code worked to disable landscape mode on this view controller prior to iOS 6:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
Since shouldAutorotateToInterfaceOrientation is deprecated in iOS6, I replaced above:
-(NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMask.Portrait; }
This method is correctly called when the view appears (I can set a breakpoint to ensure this), but the interface still rotates in landscape mode, regardless of the fact that I return the mask only for portrait modes. What am I doing wrong?
It seems that currently it is not possible to create an application that has different orientation requirements for each view. It seems that they adhere only to the orientation indicated in the project summary.
ios objective-c iphone ios6
aneuryzm Sep 16 '12 at 14:10 2012-09-16 14:10
source share