gpt4 book ai didi

iphone - 执行选择器 : withObject: afterDelay not executing for MBProgressHUD

转载 作者:行者123 更新时间:2023-11-28 17:39:16 27 4
gpt4 key购买 nike

我对 MBProgressHUD 有以下方法:

 [progressHUD performSelector:@selector(hide:) 
withObject:[NSNumber numberWithBool:YES]
afterDelay:kMessageHidingDelay];

这里的延迟是 2.0,但是它不会在 2.0 秒后调用 hide。我试图在隐藏函数中放置一个断点,但它没有到达那里。任何想法?这是完整的代码:

progressHUD = [[MBProgressHUD alloc] initWithView:viewToAttach];

// Add HUD to screen
[viewToAttach addSubview:progressHUD];
progressHUD.labelText = @"Logging In";
progressHUD.removeFromSuperViewOnHide = YES;
// Show the HUD while the provided method executes in a new thread

[progressHUD show:YES];

最佳答案

可能会尝试在主线程上执行选择器(所有 UI 更改都必须在主线程上完成)? performSelectorOnMainThread:

关于iphone - 执行选择器 : withObject: afterDelay not executing for MBProgressHUD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8810827/

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