Quote:
Originally Posted by RomanRobot
For those of you who don't know what I'm talking about:
Let's say for example I am to create a UINavigationController in the NIB. Now I expand it to show the Root View Controller of the UINavigationController. I click the Root View Controller so I can point it to an existing NIB file I've already made in the Attributes Inspector. When I click the NIB Name drop-down list, nothing. It's empty. I've tried cleaning the targets and a whole bunch of other stuff, but how would I set the Root View Controller of the Navigation Controller programmatically?
|
So I answered my own question once again. :P
I just had to import the class at the top of the App Delegate's implementation file
Code:
#import "RootViewController.h"
in the application:didFinishLaunchingWithOptions: I just had to create the RootViewController object and init the navigation controller with it.
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
RootViewController *navigationRootViewController = [[RootViewController alloc] init];
[navigationController initWithRootViewController:navigationRootViewController];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}
There's only one anomaly with my solution. When I run it, it shows the RootViewController as a detail view and the back button says Root View Controller

which when pressed goes to the... RootViewController. The same thing.

Any ideas how I could make it not start in a detail view with the same thing?