0

i have problem: there is an oriantable (rotatable) navigationcontroller with a viewcontroller. I want to change to a new navigationcontroller of viewcontroller, that is not orientable. I tried to change only the Viewcontroller with the old navigationcontroller, but in this case, the application was still rotatable.

Thanks for the help and sorry for my english.

1 Answers1

0

You have to redefine an other NavigationController and block the rotation you want. And when you want to push your view controller , call the other Navigation Controller.

YourCustomNavigationController *kiwappNav = [[YourCustomNavigationController alloc] initWithRootViewController:yourViewController];
 [self.navigationController pushViewController:kiwappNav animated:YES];

and your custom navigationController for example :

#pragma mark - Orientation
- (BOOL) shouldAutorotate
{
   return YES;
}

-(NSUInteger)supportedInterfaceOrientations{
   switch ([Device getDeviceFormat])
  {
    case DF_IPAD:
        return UIInterfaceOrientationMaskAll;
        break;
    case DF_IPOD:
        return UIInterfaceOrientationMaskPortrait;
        break;
    default:
        return UIInterfaceOrientationMaskAll;
        break;
  }
}

Hope it will help you.