gpt4 book ai didi

ios - viewDidAppear 调用了在 iOS8 中被关闭的 View Controller

转载 作者:可可西里 更新时间:2023-11-01 04:57:31 24 4
gpt4 key购买 nike

让我们假设 ParentViewcontroller 为 P,FirstViewController 为 V1,SecondViewController 为 V2。

我先介绍 P 中的 V1,然后介绍 V1 中的 V2。现在我想直接转到 P。为此我正在使用

[self.presentingViewController.presentingViewController dismissViewControllerAnimated:NO completion:nil];

这在 iOS7 中工作正常。但是在 iOS8 中,我在执行此操作时遇到了一个问题(不知道它是否是问题)。那就是 V1 的 viewDidAppear 方法被调用,并且它的 View 在屏幕上出现几分之一秒的故障。

这是 iOS8 的功能还是错误?有没有其他方法可以做到这一点?

ViewControllers 呈现代码。

来自 P,其中 P 是一个推送的 View Controller ,

ViewController1 *v1 = [[ViewController1 alloc] init];      
[self presentViewController:v1 animated:NO completion:nil];

来自 V1,

ViewController2 *v2 = [[ViewController2 alloc] init];
[self presentViewController:v2 animated:NO completion:nil];

最佳答案

您可以使用嵌入在 NavigationController (NV) 中的 V1 吗?这样,你就可以推送你的 V2.然后你可以 pop 到 V1 或者 dismiss NV 到 P。

关于ios - viewDidAppear 调用了在 iOS8 中被关闭的 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26468122/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com