0

There are many questions and answers about the changed rotation in iOS6. But I have really not solved one problem about that. Using Xcode 4.5.2. If I do not set anything in the info.plist or by the buttons “Supported Interface Orientations”, the app will rotate between portrait and landscape depending of the device rotation. Now I mean the rotation caused by how holding the device, not a default orientation when opening a ViewController.

I know how to prevent landscape mode

- (BOOL)shouldAutorotate
{

    return YES;
}

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

but it does not have any effect. Yes it has effect if I add a FlipsideController from the NavBar. In FlipsideView the code above prevents the rotation.

In the other ViewControllers it does not have any effect at all, whatever code I write.

Take a Sample given by Apple, UICatalog. Can anybode give me a hint how to controll the rotation for the whole table and also for a separate ViewController using code and not by the Buttons or info.plist which only gives a result for everything together which is not very practical for all views.

Lars -
  • 501
  • 1
  • 10
  • 27
  • Are you using a navigation controller or one of the other container view controllers? – Tommy Nov 25 '12 at 20:09
  • Have a look at the answer [here][1] that i gave. May be that can help you. [1]: http://stackoverflow.com/questions/13446633/xcode-iphone-orientation-support-for-certain-views – Mihir Das Nov 26 '12 at 06:48
  • what are you using self.navigationController or self.presentViewController – Rajneesh071 Nov 26 '12 at 12:39
  • Answer to Rajneesh071: self.navigationController – Lars - Nov 28 '12 at 15:06
  • I just use the sample UICatalog, to make it work with the rotation but modified it with the self.navigationController in Appdelegate – Lars - Nov 28 '12 at 15:08

0 Answers0