I've been having a bit of trouble with a UISplitViewController in my iPad app. I am attempting to make a simple navigation tree using the UINavigationController inside of the UISplitView. I have used the following basic code to do this:
NavController.h
@interface NavController : NSObject {
/*
* This is connected properly to the UINavigationController in the
* UISplitViewController through Interface Builder.
*/
UINavigationController *navigationController;
}
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
@end
NavController.m
#import "NavController.h"
@implementation NavController
@synthesize navigationController;
- (void) awakeFromNib {
UIViewController *testController = [[UIViewController alloc] init];
UITableView *tableView = [[UITableView alloc] init];
[testController setView: tableView];
[navigationController pushViewController: testViewController
animated: YES];
}
@end
This code successfully pushes the view to the navigation controller, and I can navigate back with the back button, however, my problem arises with the fact that after this happens, my UISplitViewController no longer auto-rotates or rotates at all from the portrait position. When I remove this code (and the view does not get pushed) it works as expected.
What am I doing wrong, and am I going about this in the right way?