I have an application designed to run Landscape. This is a Cocos2D application. It works fine until I add another window (for example, to show ads) or if I show a modal view controller.
When I do this, the window / view still rotates, although I have a set of explication shouldAutoRotate = NO
In addition, Apple says that supportedInterfaceOrientations will not be called if shouldAutorotate returns NO. However, it is called both before and after it is calledAutorotate. Why is this happening and what is the solution for controlling auto-rotation in iOS 8?
While I saw many SO issues related to auto-rotation issues in previous versions of iOS (with the most detailed description of how to set up autorotation control found in shouldAutorotateToInterfaceOrientation is not called in iOS 6 ), none of them seem to affect support problem for called interfaces, although shouldAutoRotate = NO; and the view is still spinning, even if it is told not to spin.
To fully understand my explanation, here is a description of how I installed it:
Firstly, in order to display the launch images, I had to set the device orientation to info.plist to support all orientations. Otherwise, the screen turns black at startup.
Next, here is how my code is implemented:
- (void) applicationDidFinishLaunching:(UIApplication*)application { ...
The NonRotatingViewController in the second window returns NO when calling the Functionotate function. It also returns 0 with the support of InterfaceOrientations (although it doesn't technically matter what I return because Apple says it should not be called).
For the modal view controller and the ad review controller, I tried both shouldAutorotate = NO and YES. None of the approaches will force the rotation of the second window / nrViewController. I spent days trying all kinds of combinations, but none of them work. Do you see what I can do wrong?
So, to repeat my question, why is InterfaceOrientations supported, called and why does the display still rotate, although shouldAutoRotate = NO?