で
おかげでcode
の下で試してみてください、あなたの必要性に従ってBOOL variable
を設定します。詳細はこちらあなたを参照するThis link
BOOL isLogin;
NSMutableArray *tbViewControllers = [NSMutableArray arrayWithArray:[self.tabBarController viewControllers]];
UIViewController *message = [[MessageViewController alloc] initWithNibName:@"MessageViewController" bundle:nil] ;
[tbViewControllers addObject:message];
if(isLogin){
UIViewController *profile = [[ProfileVC alloc] initWithNibName:@"ProfileVC" bundle:nil] ;
[tbViewControllers addObject:profile];
}else{
UIViewController *LoginVC = [[LoginVC alloc] initWithNibName:@"LoginVC" bundle:nil] ;
[tbViewControllers addObject:LoginVC];
}
UIViewController *more = [[[MoreViewController alloc] initWithNibName:@"MoreViewController" bundle:nil] autorelease];
[tbViewControllers addObject:more];
[self.tabBarController setViewControllers:tbViewControllers];