方法1:
performSelector(SEL) withObjects:(id) afterDelay:(NSTimeInterval);
方法2:
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//需要延时执行的代码
});
时间: 2024-10-24 08:50:18
方法1:
performSelector(SEL) withObjects:(id) afterDelay:(NSTimeInterval);
方法2:
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//需要延时执行的代码
});