gpt4 book ai didi

iphone - MBProgressHUD 没有停止

转载 作者:行者123 更新时间:2023-11-28 20:21:18 24 4
gpt4 key购买 nike

这是我的代码

MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeIndeterminate;
hud.labelText = @"Loading..";
dispatch_queue_t dispatchQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
dispatch_async(dispatchQueue, ^(void)
{
[self information];
[hud hide:YES];
});

我知道方法信息会在一段时间后完成。但即使完成后,进度条也不会消失。可能是什么原因?

最佳答案

这样做

MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeIndeterminate;
hud.labelText = @"Loading..";
dispatch_queue_t dispatchQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
dispatch_async(dispatchQueue, ^(void)
{
[self information];
dispatch_sync(dispatch_get_main_queue(), ^{
[hud hide:YES];
});
});

关于iphone - MBProgressHUD 没有停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15811430/

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