我对Objective-C很新,我正在做一个应用程序,在App启动时,会出现一个带有搜索和登录视图的tabbarController。当我点击搜索tabbaritem时,会出现SearchView。当登录tabbaritem时单击登录视图将出现..当登录成功时,将出现一个带有四个tabbaritems(搜索,配置文件,活动,注销)的tabbarcontroller。现在,当我点击注销时,我必须注销该帐户,我需要再次显示启动视图..
我怎么能这样做??我无法得到......
登录成功后我写这段代码。
UITabBarController *tabBarController=[[UITabBarController alloc]init];
SearchViewController *searchViewController=[[SearchViewController alloc]initWithNibName:@"SearchViewController" bundle:nil];
Profile *userprofile=[[Profile alloc]initWithNibName:@"Profile" bundle:nil];
userprofile.title=@" Profile";
Activities *activities=[[Activities alloc]initWithNibName:@"Activities" bundle:nil];
activities.title=@"Activities";
tabBarController.viewControllers=[NSArray arrayWithObjects:searchViewController,userprofile,activities, nil];
[self presentModalViewController:tabBarController animated:NO];
现在我想添加另一个tabbaritem作为Logout,当它被点击时我想再次加载带有Searchview和LoginView的tabbarcontroller ......怎么样?
任何帮助将不胜感激..
答案 0 :(得分:0)
在点击退出时写下以下代码
[self dismissModalViewControllerAnimated:YES];