【发布时间】:2011-03-29 18:54:39
【问题描述】:
我遇到了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];
视图不是从 navigationController 中“弹出”的,但是当按下导航栏中的标准后退按钮时,只有导航栏发生变化,而不是实际视图。
有人知道为什么会这样吗?
【问题讨论】:
-
您应该等到用户关闭警报。这样可以减少用户的困惑。
-
好点!我实现了它,现在它可以工作了。非常感谢你。我不确定这里的政策是什么。也许你应该留下一个我可以接受的答案?
-
我已经给出了答案,但实际上这是关于用户体验的建议。很高兴它起作用了:)
标签: iphone sdk popviewcontroller