http://blog.csdn.net/worldzhy/article/details/41312713
- (void)viewDidDisappear:(BOOL)animated {
//因为点击登录离开页面时
if (YES == _popAsLoginFlag) {
[self.navigationController popToRootViewControllerAnimated:NO];
}
}
- (void)loginButtonClicked:(id)sender {
HSLoginViewController *loginVC = [HSLoginViewControllernew];
// [self.navigationController pushViewController:loginVC animated:YES];
//原来是从这里(个人设置页)直接push到登录页,由于登录完成后要转到首页,所以这里先把tabbar跳到首页,从首页push到登录页,这样就可以从登录页轻松跳到主页了
self.tabBarController.selectedIndex = 0;
[[self.tabBarController.viewControllers objectAtIndex:0] pushViewController:loginVC animated:YES];
//标记一下,在这个页面消失时做相应处理
_popAsLoginFlag = YES;
}
来源:https://www.cnblogs.com/zxykit/p/6164079.html