I have a tab based application in which one tab is available in both portrait and landscape mode, all the others are only available in portrait.
I am checking agains
I think if you just use the following code and it should work well.
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
// this ensures that the view that will be shown is presented in a supportred rotation
UIViewController *c = [[UIViewController alloc]init];
[viewController presentModalViewController:c animated:NO];
[viewController dismissModalViewControllerAnimated:NO];
[c release];
if ([UIViewController respondsToSelector:@selector(attemptRotationToDeviceOrientation)]) {
// this ensures that the view will be presented in the orientation of the device
// This method is only supported on iOS 5.0. iOS 4.3 users may get a little dizzy.
[UIViewController attemptRotationToDeviceOrientation];
}
}