gpt4 book ai didi

iphone - viewWillDisappear 和 viewDidDisappear 之间存在巨大延迟

转载 作者:行者123 更新时间:2023-12-03 21:15:40 32 4
gpt4 key购买 nike

这是日志输出

2013-03-16 14:02:59.301 Echo[65406:4503] child viewWillDisappear start
2013-03-16 14:02:59.303 Echo[65406:4503] child viewWillDisappear returning
2013-03-16 14:02:59.303 Echo[65406:4503] parent viewWillAppear start
2013-03-16 14:02:59.305 Echo[65406:4503] parent viewWillAppear returning
2013-03-16 14:02:59.307 Echo[65406:4503] parent finished calling popToRootViewControllerAnimated on child.navigationController
2013-03-16 14:03:30.120 Echo[65406:c07] child viewDidDisappear start
2013-03-16 14:03:30.121 Echo[65406:c07] child viewDidDisappear returning
2013-03-16 14:03:30.121 Echo[65406:c07] parent viewDidAppear start
2013-03-16 14:03:30.122 Echo[65406:c07] parent viewDidAppear returning

viewWillDisappearviewDidDisappear 之间的 30 秒很酷。这中间还发生了什么?

最佳答案

这里的问题是线程。这是因为此操作是来自 AFNetworking 代码的回调。而不是使用:

[controller.navigationController popViewControllerAnimated:NO];

需要:

// http://stackoverflow.com/questions/9411271/how-to-perform-uikit-call-on-mainthread-from-inside-a-block
dispatch_async(dispatch_get_main_queue(), ^{
[controller.navigationController popViewControllerAnimated:NO];
[self.navigationController pushViewController:newController animated:YES];
});

关于iphone - viewWillDisappear 和 viewDidDisappear 之间存在巨大延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15452763/

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