我在 popViewController
方面遇到问题。
我使用pushViewController
转到OrdersFormViewController
OrdersFormViewController *ordersFormViewController = [[OrdersFormViewController alloc] initWithNibName:@"OrdersFormViewController" bundle:nil];
[self.navigationController pushViewController:ordersFormViewController animated:YES];
[ordersFormViewController release];
从 OrdersFormViewController
我在 viewDidLoad
中显示 UIAlertView 并调用 popViewController
但这不起作用。
UIAlertView* alertView = [[UIAlertView alloc]
initWithTitle:@"Error"
message:@"Error"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[alertView release];
[self.navigationController popViewControllerAnimated:YES];
View 不是从navigationController“弹出”的,但是当按下导航栏中的标准后退按钮时,只有导航栏发生变化,而不是实际 View 。
有人知道为什么会发生这种情况吗?
最佳答案
我遇到了类似的问题,我使用它修复了它
[self.parentViewController.navigationController popViewControllerAnimated:YES];
希望有帮助。
关于iphone - popViewController 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5477477/