-1
-(NSUInteger)supportedInterfaceOrientations
{           
    return UIInterfaceOrientationMaskPortrait;
}

-(BOOL)shouldAutorotate
{
    return NO;
}

I just want to enable landscape orientation in only one view of my app. Other view must support the portrait mode only. But for iOS 6 its autorotate even I am using the latest methods of iOS 6. Expecting correct suggestion.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Rahul
  • 134
  • 6
  • check this link http://stackoverflow.com/questions/12565188/ios-6-landscape-and-portrait-orientation/14704401#14704401 – Rushabh Feb 28 '13 at 07:34
  • thanks.. but Used the method in the link still it is supporting orientation. I want portrait orientation except one view that support two landscape and Portrait. – Rahul Feb 28 '13 at 09:05
  • No its just not working.. I hav tried it earlier.. The main problem is in iOS 6. – Rahul Feb 28 '13 at 12:36

1 Answers1

0

For Portrait Only Orientation , try below method

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}

- (BOOL)shouldAutorotate {
    return FALSE;
}
Shamsudheen TK
  • 30,739
  • 9
  • 69
  • 102