我想在我的应用中弹出最后一个视图,所以我正在调用此函数:
[self.navigationController popViewControllerAnimated:YES];
和self是最后一个视图控制器,我希望应用程序退出,但这不会发生原因?
答案 0 :(得分:1)
要进入rootView,你需要调用如下,
[self.navigationController popToRootViewControllerAnimated:YES]; // Returns the root/last vie controller.
,你使用的是下面的,
[self.navigationController popViewControllerAnimated:YES]; // Returns the popped controller.
答案 1 :(得分:0)
如果您想退出自己的应用,请执行以下操作:
[[NSThread mainThread] exit]
无论如何,你的方式:
[self.navigationController popViewControllerAnimated:YES];
这在android
中很常见,而不是在iOS中。