三种常见的延时执行方式

2015-12-18  本文已影响84人  fever105

三种常见的延时执行方式

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(多少秒 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        // 需要延时执行的任务
    });
    [self performSelector:@selector(workPostponed:) withObject:nil afterDelay:多少秒];
[NSThread sleepForTimeInterval:多少秒];
上一篇 下一篇

猜你喜欢

热点阅读