用GCD实现延迟执行任务

用GCD实现延迟执行任务

//    [self performSelector:@selector(doSomething)

//               withObject:nil

//               afterDelay:5.0];

//Using dispatch_after

dispatch_time_t time = dispatch_time(DISPATCH_TIME_NOW, (int64_t) (5.0 * NSEC_PER_SEC));

dispatch_after(time, dispatch_get_main_queue(), ^(void) {

[self doSomething];

//签到

[selfuserSignView];

});

你可能感兴趣的:(用GCD实现延迟执行任务)