我对 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/