application delegate에서 앱의 window의 가장 첫번째 subView로 tabBar의 view를 넣고, tabBarController에 viewController들을 추가하면 된다.
대부분 view 이동에 navigationController를 사용하므로 viewController로 초기화된 navigationController를 넣어도 된다.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// 가장 최상위에 깔아놓는 Window를 생성한다.
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// tabBar를 생성한다.
_tabBarController = [[UITabBarController alloc] init];
_tabBarController.customizableViewControllers = nil;
// root로 사용될 ViewController를 생성한다.
viewController = [[test1ViewController alloc]init];
_navigationController = [[UINavigationController alloc]initWithRootViewController:viewController];
_viewController2 = [[test2ViewController alloc]init];
_navigationController2 = [[UINavigationController alloc] initWithRootViewController:_viewController2];
// tabBar에 위에서 생성한 navigationController들을 넣는다.
_tabBarController.viewControllers = [NSArray arrayWithObjects: _navigationController, _navigationController2, nil];
// tabBar를 window의 가장 처음 view로 넣는다.
// Override point for customization after application launch.
//[self.window addSubview:_navigationController.view];
[self.window addSubview:_tabBarController.view];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}



