-2

I am using Xcode 6 and iOS. I just created a new project to test out the following code:

- (BOOL)shouldAutorotate
{
return NO;
}

I inserted it in ViewController.m under the @implementation ViewController, yet when I simulate it, I am still able to rotate it using Command + Right Arrow. Is that the correct way to lock an application to use only the default portrait orientation?

JAL
  • 41,701
  • 23
  • 172
  • 300
Ko Ki
  • 43
  • 1
  • 5

1 Answers1

3

Change "Device Orientation" under Project -> Targets -> Deployment Info:

image

JAL
  • 41,701
  • 23
  • 172
  • 300