0

I've found what appears to be the answer to my question here:

iOS 6: How do I restrict some views to portrait and allow others to rotate?

BUT i don't understand the answer. I'm confused as to where i'm supposed to be putting the code for the UINavigationController. It can't be in the UINavigationController.h file because thats locked. Someone please help

Layth

Community
  • 1
  • 1
LaythT
  • 23
  • 4

2 Answers2

0

Instead of putting the code in the UINavigationController.h, you should create a new class called MainNavigationController and inherit UINavigationController.

You can then add a Boolean in the new class called landscapeOK, and then make your ViewController inherit from MainNavigationController instead of UINavigationController.

Sean O'Toole
  • 4,304
  • 6
  • 35
  • 43
isso
  • 9
  • 2
  • How do make it inherit? Do I use the code '#import UINavigationController.h' at the top of MainNavigationController? – LaythT Feb 10 '13 at 09:35
  • And how do i make my viewcontroller inherit from MainNavigationController instead of UINavigationController? – LaythT Feb 10 '13 at 09:45
  • Please check this link http://stackoverflow.com/questions/10109480/uinavigationcontroller-subclass-customizing-pop – isso Feb 10 '13 at 09:58
0

Use this in View did load set direction

 UIViewController *c = [[UIViewController alloc]init];
    [self presentModalViewController:c animated:NO];
    [self dismissModalViewControllerAnimated:NO];
Ram Vadranam
  • 485
  • 5
  • 14