我正在尝试从一个 Tabbar 索引移动到另一个 Tabbar 索引,但它无法工作。实际上,当应用程序加载显示标签栏 1 时,默认情况下我有三个标签栏索引。
在 0 标签索引处,我有我的帐户页面,当有人按 Tabbar 0 时,我不想直接访问我的帐户标签栏(无需登录),然后登录页面在用户成功登录时在登录页面打开,然后我使用以下方法显示第一个标签栏。
// define the target method
-(void) targetMethod:(NSTimer *) theTimer
{
sessId = wsobject.sessId;
singletonOjb = [SingletonClass sharedManager];
singletonOjb.sessId = sessId;
singletonOjb.Username = wsobject.getname;
if (sessId != NULL)
{
singletonOjb.password = password.text;
userName.text = @"";
password.text = @"";
[MBProgressHUD hideHUDForView:self.view animated:YES];
[self storeFavObj];
[self dismissViewControllerAnimated:YES completion:nil];
self.tabBarController.selectedIndex = 0;
}
else
{
//userName.text = @"";
password.text = @"";
[MBProgressHUD hideHUDForView:self.view animated:YES];
}
}