i'm in really bad situation, i have to submit my app, but i have discovered one problem :
My app is a Nav based app, in this app i want only one controller to be able to landscape :
--> Root Controller --> WelcomeController --> LandscapeController
In the landscape controller i have set two views inside the main view, one is portrait mode to tell the user he has to turn the device, the other is set to landscape (in the main view which is in portrait mode)
I have subclassed my navigation controller : MyNavController in which i have set :
- (BOOL)shouldAutorotate
{
return self.topViewController.shouldAutorotate;
}
- (NSUInteger)supportedInterfaceOrientations
{
return self.topViewController.supportedInterfaceOrientations;
}
So the controller on top of the hierarchy decide if the navController can rotate or no.
in my app delegate i have set :
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return (UIInterfaceOrientationMaskAll);
}
so i can have both orientation on my app.
In the Welcome Controller i have set :
- (NSUInteger)supportedInterfaceOrientations
{
return (UIInterfaceOrientationMaskPortrait);
//return (UIInterfaceOrientationPortrait);
}
- (BOOL)shouldAutorotate
{
return YES;
}
Which means the Welcome Controller can only be in portrait mode.
In the Landscape Controller i have set :
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (BOOL)shouldAutorotate
{
return YES;
}
so that the landscape Controller can rotate.
I call Landscape controller using :
LandscapeController *aLandscapeController = [LandscapeController] allo] init....
[self.navigationController pushViewController:aLandscapeController animated:YES];
It works, but sometimes believe me or not, when i push the landscape Controller and that i turn the device, it is the Welcome Controller which become landscape and take only half of the screen because it can't be in landscape and this so bad to me you can't imagine.
What can i do to avoid that ?
i'll take any help, i'll make donation if i have to.
Thank you very much.