我正在使用iPhone应用程序。我必须通过以下代码跳转到ProfileViewController(来自HomeViewController):
ProfileViewController *ProfilePage = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];
ProfilePage.RequestType = 2;
ProfilePage.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
UINavigationController *navigationControllerNew = [[UINavigationController alloc] initWithRootViewController:ProfilePage];
//Present navigationController as Model viw controller
[self.navigationController presentModalViewController:navigationControllerNew animated:YES];
//release it After presenting to it
[navigationControllerNew release];
[ProfilePage release];它工作得很好,但是当我点击ProfileViewController的"Last view“按钮回到同一页时,它又回来了,但是回来之后。我的popToViewController on back按钮在HomeScreenController上不起作用。可能是因为堆栈中有新的导航控制器。
我在哪里犯了错?怎样才能让我的后退按钮再次生效?
发布于 2011-07-19 20:51:48
你不需要使用popToViewController之类的东西。
使用dismissModalViewControllerAnimated:方法返回主视图。
发布于 2011-07-19 20:50:07
你不需要
UINavigationController *navigationControllerNew = [[UINavigationController alloc] initWithRootViewController:ProfilePage];这应该是可行的
[self.navigationController presentModalViewController:ProfilePage animated:YES];发布于 2011-07-19 20:57:22
您可以使用以下命令:
[self presentModalViewController:ProfilePage animated:YES]https://stackoverflow.com/questions/6747328
复制相似问题