0

これは 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で作成したいRegisterViewController。どうすればいいですか?AppDelegate.mもしすでにログインしている場合はを作成しTabBarController、そうでない場合は に移動しRegisterViewController登録が完了した場合は を作成しますTabBarController。これを行う方法?ありがとう。

4

2 に答える 2

0

ログインを表示して、tabBarController.viewby[self.tabBarController presentViewController:]などの上にビューを登録するだけです。

于 2013-03-04T12:33:49.350 に答える
0

AppDelegate で public メソッドを作成し、通常どおりそこにタブバーを作成します。そして、必要な場所でこのメソッドを呼び出します:

[(ASAppDelegate *)[[UIApplication sharedApplication] delegate]yourMethod]
于 2013-03-04T12:57:05.077 に答える