UIInterfaceOrientationLandscapeLeft/Right are reversed

Originator:jaka
Number:rdar://7216046 Date Originated:11-Sep-2009 05:08 PM
Status:Duplicate/7359346 Resolved:
Product:iPhone SDK Product Version:3.0
Classification:Other Bug Reproducible:Always
 
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 this is not the case. If I add the following code to RootViewController.m of the default Navigation-based app template:

-----
+ (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 get UIInterfaceOrientationLandscapeLeft if I rotate the device clockwise (so the home button is on the left). According to the documentation, I should get UIInterfaceOrientationLandscapeRight.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!