UINavigationController *loginNavCon = [[UINavigationController alloc] init];
loginNavCon.navigationController.navigationBarHidden=YES;
loginNavCon.navigationBar.barStyle = UIBarStyleBlack;
//I created navigationcontroller hear
PushMe *p=[[PushMe alloc]initWithNibName:@"PushMe" bundle:[NSBundle mainBundle]];
//这是一个简单的ControllView。只有颜色视图
[loginNavCon pushViewController:p animated:YES];
NSArray *currentViewControllers = [loginNavCon viewControllers];
NSMutableArray *vcs = [NSMutableArray arrayWithArray:currentViewControllers];
[loginNavCon setViewControllers:vcs animated:NO];
[loginNavCon popViewControllerAnimated:YES];
[loginNavCon popToViewController:p animated:YES];
答案 0 :(得分:0)
设置根目录:
initWithRootViewController:(UIViewController *)rootViewController
如果您弹出,它将返回此VC。