方法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(), ^{
//需要延时执行的代码
});
方法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(), ^{
//需要延时执行的代码
});
转载于:https://www.cnblogs.com/lifengfneg/p/4773846.html