gpt4 book ai didi

ios - 隐藏 Nib 内容直到任务完成

转载 作者:行者123 更新时间:2023-11-29 03:36:52 25 4
gpt4 key购买 nike

我正在尝试完成一项任务,然后希望将 xib 内容显示在 View 上。但是VC是通过nibFile初始化的,有没有办法在任务完成后延迟加载nib?

谢谢

最佳答案

在viewDidLoad中:

self.view.hidden = YES;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// do your background tasks here
[self doSomethingInBackground];

// when that method finishes you can run whatever you need to on the main thread
dispatch_async(dispatch_get_main_queue(), ^{
self.view.hidden = NO;
});
});

(改编自Implement a block in background, then after completion run another block on main thread?)

关于ios - 隐藏 Nib 内容直到任务完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19057944/

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