方法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-12-30 02:56:59
方法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(), ^{
//需要延时执行的代码
});