I'd like to be able to have the user tap a button on the flipsideViewController of a Utility template application. This would then have the device push another view controller. Using Interface Builder, I've tried adding a UINavigationController in the FlipsideView.xib, but that doesn't feel like the right place for it. I've also tried adding it to MainWindow.xib, but I couldn't figure out how to link that to the FlipsideViewController. I've also just tried doing it simply in code like this:
Code:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// In FlipSideViewController.h: UINavigationController *navigationController;
self.navigationController = [[UINavigationController alloc] initWithRootViewController:self];
[self.view addSubview:navigationController.view];
NSLog( @"Added subview" );
}
return self;
}
but that causes it to crash when I tap the info button despite the fact that "Added subview" is displayed on the debugger console. What would be the recommended way of doing this? A push in the right direction would be great at this point... I've wasted an entire evening trying to figure this out. Thanks!