Created
February 13, 2012 06:06
-
-
Save mluton/1814165 to your computer and use it in GitHub Desktop.
iOS: UITabBarController with UINavigationController Views
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; | |
UIViewController *viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil] autorelease]; | |
UIViewController *viewController2 = [[[TableViewController alloc] initWithNibName:@"TableViewController" bundle:nil] autorelease]; | |
UINavigationController *navigationController1 = [[[UINavigationController alloc] initWithRootViewController:viewController1] autorelease]; | |
UINavigationController *navigationController2 = [[[UINavigationController alloc] initWithRootViewController:viewController2] autorelease]; | |
self.tabBarController = [[[UITabBarController alloc] init] autorelease]; | |
self.tabBarController.viewControllers = [NSArray arrayWithObjects:navigationController1, navigationController2, nil]; | |
self.window.rootViewController = self.tabBarController; | |
[self.window makeKeyAndVisible]; | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment