iPad orientation returns unknown values

I use this code:

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];

to get iPad orientation but it returns UIDeviceOrientationUnknown when I use OpenGL rendering. When I play movies or I display UIViews it return the correct value. Do you know how may I get correct orientation? I don't want to use the accelerometer because I want to know when the device has locked orientation.

Thank you!

6
задан Moak 10 November 2010 в 15:08
поделиться