0

I have the following code that should keep a view controller in PORTRAIT mode but it does not do the trick. What can I do?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
Fogmeister
  • 73,141
  • 39
  • 203
  • 288
Chris Hansen
  • 6,293
  • 12
  • 67
  • 141
  • 1
    Is the view controller being presented or controlled by another? – jscs Jul 07 '13 at 20:32
  • 2
    Do you want to stop auto rotation for all view controllers or just one? Also, that code doesn't work in iOS6. Also, there a bazillion questions that are all exactly the same already on SO. Please search before posting a new one. – Fogmeister Jul 07 '13 at 21:00
  • If that view is presented from another view controller that allows the rotation, it will rotate – Antonio MG Jul 07 '13 at 20:59
  • Not the way he did it above though... see the duplicate identified by Fogmeister. – Till Jul 07 '13 at 21:04

0 Answers0