gpt4 book ai didi

ios - pushViewController 极慢

转载 作者:技术小花猫 更新时间:2023-10-29 10:58:07 26 4
gpt4 key购买 nike

什么会导致 pushViewController 非常慢? (显示新 View 需要 30+秒)

基本上,我正在做这样的事情:

SecondViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"correctID"];
vc.something = something;
[self.navigationController pushViewController:vc animated:YES];
CLS_LOG(@"Pushed Controller...");

并且我在第二个 View Controller 内的 viewdidload 的开头进行记录。我没有子类化其他方法。

在 Pushed Controller... 和来自 viewdidload 的下一个日志之间有一个巨大的延迟。

你会如何调试它?

我已经尝试使用 TimeProfiler,但显然它什么也没显示。

最佳答案

之前遇到过类似的问题,试试下面的方法

dispatch_async(dispatch_get_main_queue(), ^{
// your navigation controller action goes here
});

关于ios - pushViewController 极慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25754629/

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