- 第一种方法:
[self performSelector:(SEL) withObject:(id) afterDelay:(NSTimerInterval)];
- 第二种方法:
// GCD(高级,纯c语言)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// code to be executed after a specified delay
});