shouldAutorotateToInterfaceOrientation called several times in a row without any rotation
Posted
by Mike
on Stack Overflow
See other posts from Stack Overflow
or by Mike
Published on 2010-04-12T11:39:22Z
Indexed on
2010/04/12
11:43 UTC
Read the original article
Hit count: 876
I am trying to implement some interface changes in my app, based on the device rotation.
My app is a view based app. So, its main view controller has a didload method.
The app starts in portrait. Almost all changes on the device orientation triggers the shouldAutorotateToInterfaceOrientation method but this method is not called when the device is put on portrait, after coming from any landscape orientation.
While debugging the app, I have put a
NSLog(@"orientation=%d", interfaceOrientation);
on my shouldAutorotateToInterfaceOrientation method, and what I see is quite strange:
- When I run the app, shouldAutorotateToInterfaceOrientation is called 6 times before the app's interface even appears. Every time it runs, it reports a different number for the orientation: the order it reports on console is: portrait, portrait, portrait, landscape right, landscape left, upside down) (????).
During this time the app is just beginning. All 6 times the debugger reports the method being run by the app's delegate.
So, here comes the questions:
- WHy shouldAutorotateToInterfaceOrientation is not being called when the device enters on portrait?
- Why is this method running 6 times called by the delegate even before the app starts and shows its interface if no rotation is being done?
thanks.
© Stack Overflow or respective owner