Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIDeviceOrientationUnknown in landscape mode

I am trying to figure out what orientation the iphone has in the simulator and instead of giving it to me using the UIDevice orientation property I just get UIDeviceOrientationUnknown.

Does this property not work in the simulator? What could be the possible reason for this happening?

I am using opengl es

like image 424
Mel Avatar asked Dec 21 '09 17:12

Mel


1 Answers

You can also use:

UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];  

which works even without calling beginGeneratingDeviceOrientationNotifications.

like image 102
Chintan Patel Avatar answered Sep 21 '22 14:09

Chintan Patel