I am writing an application in the latest version of Xcode for iPad with iOS version 5.1. For all views, you need to set a fixed value for the orientation UIInterfaceOrientationLandscapeLeft. In the storyboard set the landscape for scene's. In -shouldAutorotateToInterfaceOrientation: writing

return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); 

After I make the build, the simulator opens in portait and the UI also looks like, when imitating the rotation of the device, everything turns (i.e. fixed in portrait-mode, but in landscape). Screenshots in the builder and on the simulator:

alt text

alt text

In the simulator, in the scheme and in the deplyment target, 5.1 is set. How to solve the problem?

    2 answers 2

    It's very simple really
    In Xcode, select the project (in the menu on the left, the name of the project), the menu on the right appears, select targets (project name) in it, select Supported Interface Orientation in the menu that appears, select supported screen orientations. What select such and will be supported.

    • I chose the only desired orientation, now the simulator is launched in it, but the application "lies on its side" as if attached to portrait orientation. I do not understand how binding to the portrait mode and how to remove it happen - AlexThumb
    • can try to comment -shouldAutorotateToInterfaceOrientation in the controller and other methods that are related to orientation? can help, try. - Kobayashi_Maru
    • I tried it, but in an incomprehensible way, it shows once and for all that is normal then again "on its side". I don’t understand what it depends on yet - AlexThumb

    It was decided unexpectedly. The customer stated that the application is for the sixth axis, the methods have been rewritten and with the methods for the sixth everything works fine