I have created a subclass of UITabBarController to deal with the autoRotation of views when I switch as I need some views to be portrait and others landscape.
If I rotate the device this all works as expected, so the landscape ones will rotate to landscape and stay that way. The issue I am having is that the rotation isn't automatically performed when the view shows. So the views that are meant to be landscape are shown as portrait until the device is rotated to landscape, at which point they will lock it to landscape mode.
I was wondering if anyone can tell me how to force the rotation upon view change, so when I switch to a landscape view it will rotate to that orientation straight away?
Sorry if this has been asked a million times before but I can't seem to find the threads.
EDIT, I HAVE FOUND THE FOLLOWING CODE:
UIViewController *c = [[UIViewController alloc]init];
[self presentModalViewController:c animated:NO];
[self dismissModalViewControllerAnimated:NO];
[c release];
This does perform the rotation, but I'm not sure where to call it as the tab bar controller doesn't call things such as init / viewDidLoad, obviously putting it in viewDidAppear etc will cause an infinite loop.
Any help on this please?