这是 RegisterViewController.m 部分
if ([message isEqualToString:@"registerOK"]){
self.findViewController = [[FindViewController alloc] initWithNibName:nil bundle:NULL];
self.friendViewController = [[FriendViewController alloc] initWithNibName:nil bundle:NULL];
self.goViewController = [[GoViewController alloc] initWithNibName:nil bundle:NULL];
self.settingViewController = [[SettingViewController alloc] initWithNibName:nil bundle:NULL];
self.findNavigationController = [[UINavigationController alloc] initWithRootViewController:self.findViewController];
self.friendNavigationController = [[UINavigationController alloc] initWithRootViewController:self.friendViewController];
self.goNavigationController = [[UINavigationController alloc] initWithRootViewController:self.goViewController];
self.settingNavigationController = [[UINavigationController alloc] initWithRootViewController:self.settingViewController];
//[self.findNavigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav-bar-background-light.png"] forBarMetrics:UIBarMetricsDefault];
[self.findNavigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav-bar-background-light.png"] forBarMetrics:UIBarMetricsDefault];
[self.friendNavigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav-bar-background-light.png"] forBarMetrics:UIBarMetricsDefault];
[self.goNavigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav-bar-background-light.png"] forBarMetrics:UIBarMetricsDefault];
[self.settingNavigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav-bar-background-light.png"] forBarMetrics:UIBarMetricsDefault];
NSArray *allViewController = [[NSArray alloc] initWithObjects:self.findNavigationController,self.friendNavigationController,self.goNavigationController,self.settingNavigationController, nil];
self.tabBarController = [[UITabBarController alloc] init];
[self.tabBarController setViewControllers:allViewController];
UIWindow *window = [UIApplication sharedApplication].keyWindow;
[self.view addSubview:self.tabBarController.view];
[window setRootViewController:self];
}
我想创建一个TabBarController
in RegisterViewController
。我该怎么做?在AppDelegate.m
我有一个 if :如果已经登录然后创建TabBarController
,如果没有去RegisterViewController
,那么如果注册完成我想创建TabBarController
。这个怎么做?谢谢。