The documentation says:
UIInterfaceOrientationLandscapeLeft
The device is in landscape mode, with the device held upright and the home button on the right side.
UIInterfaceOrientationLandscapeRight
The device is in landscape mode, with the device held upright and the home button on the left side.
However, I'm getting them exactly reversed. Can there really be such a mistake in the SDK, or am I just going crazy?
Code:
+ (NSString *)NSStringFromUIInterfaceOrientation:(UIInterfaceOrientation)o
{
switch (o) {
case UIInterfaceOrientationPortrait: return @"UIInterfaceOrientationPortrait";
case UIInterfaceOrientationPortraitUpsideDown: return @"UIInterfaceOrientationPortraitUpsideDown";
case UIInterfaceOrientationLandscapeLeft: return @"UIInterfaceOrientationLandscapeLeft";
case UIInterfaceOrientationLandscapeRight: return @"UIInterfaceOrientationLandscapeRight";
}
return nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
NSLog(@"Should: %@", [[self class] NSStringFromUIInterfaceOrientation:toInterfaceOrientation]);
return YES;
}
I paste the above code in RootViewController.m of the default Navigation-based app template.
Follow-up: Reported as bug 7216046.