views:

89

answers:

0

Hi all,

I have an IPad auto rotation problem. I have a UINavigationController, managing a stack of UIViewControllers. They all implement the method -

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

At the bottom of the UIViewController stack I push a new UIViewController which implements the same method as follows:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

This allows the bottom view controller to auto rotate to landscape mode as required and works correctly on both IPhone and IPad. On the IPhone when I pop this view controller, the system correctly auto-rotates back to portrait only, however on the IPad with the same build, it does not.

The project is built with the IOS4 sdk, however the problem also existed in the 3.0 sdk. The code is IPhone code (as in I have not used the Upgrade to IPad feature, im simply using an IPhone app on an IPad).