0

I've tried the following methods to force landscape on one of my views:

- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;

}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeLeft;

}

- (BOOL)shouldAutorotate{
return YES;

}

Neither did work. Note that I'm testing on the simulator and on an iPhone

Thanks

Ratikanta Patra
  • 1,177
  • 7
  • 18
sai
  • 479
  • 10
  • 30
  • I am using NavigationControler for pushing Views.{UINavigationController *navigationController[[UINavigationController alloc]initWithRootViewController:[[MiddleViewController alloc] init]]; [self.window navigationController]; return YES; – sai Apr 07 '14 at 12:25
  • Possible duplicate: http://stackoverflow.com/questions/16780545/ios6-preferred-interface-orientation-not-working – Ratikanta Patra Apr 07 '14 at 12:41

1 Answers1

0

please goto Targets in Xcode and in Generate Category select Device Orientation ticked for Landscape Orientation.

hmdeep
  • 2,910
  • 3
  • 14
  • 22