If a Single View app is created for iPad, depending on the Supported Device Orientation is set for the plist, and what shouldAutorotateToInterfaceOrientation
returns, shouldAutorotateToInterfaceOrientation
can be called 10, 12, or even 13 times.
One simple case is, if the "Support Device Orientation" is set to Landscape Left, and shouldAutorotateToInterfaceOrientation
also returns YES
only for Landscape Left, then if I start the app in Landscape Left orientation, then shouldAutorotateToInterfaceOrientation
will be called 12 times in a row. If I hold it in other orientation and start the app, then it is 13 times.
What is the reason that it is called so many times in a row?
As i can see at UIDevice.h, orientation type is not used as a mask and several requests should be performed:
The whole process could happen more than one time for a single orientation change (e.g. the system might want to send the correct notification to the application window the status bar might want to check the orientation independently, welcome to OOP, i'm not saying it happens, but it might) while the results of the 1st or 2nd stages might be somehow cached by one component and not by another.