1
votes

I've got a very strange behavior in my iPhone app.

The app should run in any orientation. Plist keys are all set and shouldAutorotateToInterfaceOrientation always returns YES.

Also, it's an iPhone only app, but at this moment I can test it only on the iPad.

Now, when I start it in portrait mode, everything works fine. However, if it launches in landscape mode, the view doesn't receive any touch input, buttons and gestures simply don't work. This is happening as long as the window remains unaltered. If I rotate the app and then rotate it back to landscape, it works. Moreover, if I press the "2x" button on the iPad, the app also starts to work normally.

I've checked all view frames and everything is drawn correctly.

When run in simulator, it ignores the initial orientation and draws itself in portrait mode.

What can be the reason and how to solve it?

1
Are you compiling on new iOS 6.0 SDK? If you are migrating old code to iOS 6.0 screen rotation handling have been changed. If that is the case, you can have a look at: stackoverflow.com/questions/12536645/… - iMathieuB
Greg Hewgill and I stumbled across another solution, checking the status bar "hide during application launch" option. Makes no sense, but the bug seems to disappear. See my updated answer. - Rob

1 Answers

4
votes

I have found that this is unique to iOS 6 (you'll see this on iPads running iOS 6 and even the iOS 6 iPad simulator, but not devices/simulator running iOS 5). If you remove all of the entries under "Supported interface orientation" in the app's plist, this problem seems to go away. Alternatively, if you check the "Hide during application launch" option for the "Status Bar" settings on the Summary screen of the Target settings, this also fixes it:

enter image description here

It makes no sense why either of these should fix the bug, but they appear to.

If you use the "Supported Orientations" tweak, in iOS 6, you can still programmatically control the permitted interface orientations via supportedInterfaceOrientations (in iOS 5, you can still useshouldAutorotateToInterfaceOrientation:).