I have a class of UINavigationController (and linked to the storyboard “mainNavCont”) containing:
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"init");
}
- (void)viewDidAppear:(BOOL)animated
{
NSLog(@"View Appeared");
UINavigationController *selfNavController = [self navigationController];
[selfNavController performSegueWithIdentifier:@"rootToPortSeg" sender:self];
}
There is a segue in the storyboard with the identifier “rootToPortSeg”, type is “push”, that links to a UIViewController called “portViewCont”. In that class there is the following:
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"I am the port");
}
Everything compiles fine and I get no errors in Xcode. But the portViewCont UIViewController never loads or displays or anything. I am still new to iOS and for the life of me I can’t figure out what I am doing wrong. I get “init” and “View Appeared” in the console but not “I am the port”, Thanks SO!

After thinking some more about this problem, I think the best way to go would be to use a custom container controller with a portraitController and landscapeController as its children.
In the following code, I instantiate the 2 child controllers in the container controller’s init method, and have strong properties pointing to them so, that when switching back and forth, you’ll be accessing the same instances. I set up the initial view controller in the method that checks for the device orientation at start-up, and then do the switching of the controllers in a call back to the UIDeviceOrientationDidChangeNotification. Finally, the actual switching with animation is done using the transitionFromViewController:toViewController:duration:options:animations:completion: method.