生成Window
例子:
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
//创建主页面
[self loadMainFrame];
//加载window
[self.window makeKeyAndVisible];
- 创建UINavigationController
UIView *view = [[UIView alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
navigationController.tabBarItem.title = @"...";
navigationController.tabBarItem.image = [UIImage imageNamed:@"..."];
- 创建UITabBarController
UITabBarController *tabBarController = [[UITabBarController alloc] init];
[tabBarController setViewControllers:@[viewController, ...];
self.window.rootViewController = tabBarController;