views:

301

answers:

1

So for complicated reasons I am managing view rotations myself, and am only implementing UIDeviceOrientationPortrait as the autorotating orientation.

Anyway, when one clicks the screen lock on the iPad, the device will rotate to UIDeviceOrientationPortrait, which will cause my code to rotate, which I do not want to happen. For instance of the user is holding the device in "landscape mode", i.e. I have already manually rotated the UI to landscape mode, and he/she clicks the screen lock, it will rotate the UI to portrait mode, even though the user did not move the device at all.

So somehow I need a way to differentiate between rotations to portrait mode occuring from the screen lock, and those occuring from device rotation. As such, I would like somehow to use the accelerometer to detect whether or not the device was actually 'rotated' or whether the button was clicked.

Thanks!

A: 

Apparently it's working now.

I recently tested my old iPad project after installing the latest XCode & iPhone SDK and I no longer receive UIInterfaceOrientationPortrait when the lock is switched on. Haven't changed my code at all so it must be Apple.

vakio