一:没有导航栏的
LoginViewController * yy=[LoginViewController new];
UIApplication * app=[UIApplication sharedApplication];
app.keyWindow.rootViewController=yy;
二:有导航栏的
LoginViewController * yy=[LoginViewController new];
LSXNavgationViewController * nav=[[LSXNavgationViewController alloc]initWithRootViewController:yy];
UIApplication * app=[UIApplication sharedApplication];
app.keyWindow.rootViewController=nav;
三:返回想要去的页面(从根视图算起为0)
LoginViewController *yy = [self.navigationController.viewControllers objectAtIndex:2];
[self.navigationController popToViewController:yy animated:YES];
网友评论