I started a sample project and added the following code to my view controller. After launch the screen will be on landscape. Then I went to my Storyboard, clicked on my only view, -> editor -> embed in -> Navigation Controller. Launch the program again: the screen will be on portrait and won't change to landscape no matter what I try. Why is that? (All orientations are enabled in my plist.)
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
@end