I\'m creating a game that allows the device to be in either landscape-left or landscape-right orientation, and the player can change the orientation while it\'s paused. Whe
Listen for device orientation changes:
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(deviceOrientationDidChangeNotification:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
When notified, get the device orientation from UIDevice:
- (void)deviceOrientationDidChangeNotification:(NSNotification*)note
{
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
switch (orientation)
{
// etc...
}
}