Reputation: 291
I got this code on didFinishLaunching but I don't know how to customize it to open up menuViewController from when I open the app.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
// At the end of applicationDidFinishLaunching, right before
// the return YES
[[GCTurnBasedMatchHelper sharedInstance] authenticateLocalUser];
return YES;
}
hope someone can help me out
Upvotes: 0
Views: 203
Reputation: 1480
Change the following line
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
to
self.viewController = [[[menuViewController alloc] initWithNibName:@"menuViewController" bundle:nil] autorelease];
Upvotes: 1
Reputation: 204
Create the object of menuViewController
assign this controller to rootViewController
.
self.viewController = [[[MenuViewController alloc] initWithNibName:@"menuViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
Upvotes: 0
Reputation: 23634
The line you need to change is
self.window.rootViewController = self.viewController;
To
MenuViewController *menuViewController = [[[MenuViewController alloc] init] autorelease];
self.window.rootViewController = menuViewController;
This is assuming you have a custom view controller called MenuViewController
Upvotes: 0