Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我SVProgressHUD在我的项目中用作活动指示器。我不想显示HUD我的数据加载速度是否超过 3 秒,它应该仅在此时间段之后显示。我无法延迟加载SVProgress HUD.
SVProgressHUD
HUD
SVProgress
使用以下代码:
[self performSelector:@selector(addHUD) withObject:nil afterDelay:3.0f];
如果数据在 3 秒调用前加载
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(addHUD) object:nil];
还要在 dealloc 方法中添加上述行。