标签:
1.NSObject方法performSelector:withObject:afterDelay:
[self performSelector:@selector(run) withObject:nil afterDelay:2.0];
2.NSTimer方法
[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(run) userInfo:nil repeats:NO];
3.GCD
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ NSLog(@"run-----"); });
标签:
原文地址:http://www.cnblogs.com/sea-star3/p/5301015.html