gpt4 book ai didi

iphone - 调用 popToRootViewControllerAnimated :NO, 将 animate 设置为 YES 时崩溃,工作没有崩溃,奇怪。

转载 作者:行者123 更新时间:2023-12-02 15:16:03 27 4
gpt4 key购买 nike

我的应用程序是基于UINavigationViewController的,堆栈中有3个ViewController,分别命名为A、B、C,A是 Root View Controller ,现在在ViewController C中执行以下操作,应用程序将崩溃100%。

- (void) delayPopAction {
[[self navigationController] popToRootViewControllerAnimated:NO];
}

- (void)searchTap:(id)sender{
[self performSelector:@selector(delayPopAction) withObject:nil afterDelay:3.0];
}

通过僵尸追踪,发现C的崩溃费用已被销毁,但仍有事件发送给他。更奇怪的是,如果我把动画参数从NO改为YES,并没有发生崩溃,可能是因为C的生命周期被扩大了。

请参阅 API 文档。不 是什么意思?不太明白。
动画将此值设置为 YES 可以为过渡设置动画。如果您在显示导航 Controller 的 View 之前设置导航 Controller ,请传递“否”。

任何想法或建议将不胜感激,提前致谢。

最佳答案

哦,这是我的 View Controller 实现缺陷。

关于iphone - 调用 popToRootViewControllerAnimated :NO, 将 animate 设置为 YES 时崩溃,工作没有崩溃,奇怪。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8896248/

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