1.NSThread中的方法
// 2.0s以后会自动调用self的hidHUD方法
[self performSelector:@selector(hideHUD) withObject:nil afterDelay:1.5];
2.GCD中的延时
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self.hud.alpha = 0.0;
});
3.定时器延时
[NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(hideHUD) userInfo:nil repeats:NO];