我只是在将堆栈弹出到rootviewcontroller之后才尝试将新的视图控制器推送到导航堆栈
//Select the tab I want to go to
self.tabBarController.selectedIndex = FEEDPAGE_INDEX;
//Retrieve the navcon in the feed page
UINavigationController *navcon = (UINavigationController*)[self.tabBarController.viewControllers objectAtIndex:FEEDTAB_INDEX];
//Pop to root view controller here
[navcon popToRootViewControllerAnimated:YES];
//Push a new root view controller onto stack
QuestionAnswerViewController *x = [[QuestionAnswerViewController alloc]init];
[navcon pushViewController:x animated:YES];
推送不起作用,即没有显示新页面 . 似乎popToRootViewController导致这种情况发生(确切地说不确定) . 关于如何弹出然后推新页面的任何建议?
1 回答