Object C基础回顾

延时方式

2017-09-08  本文已影响0人  DVWang

延时操作

1

[NSTimer scheduledTimerWithTimeInterval:<#(NSTimeInterval)#> target:<#(nonnull id)#> selector:<#(nonnull SEL)#> userInfo:<#(nullable id)#> repeats:<#(BOOL)#>];

2

[self performSelector:<#(nonnull SEL)#> withObject:<#(nullable id)#> afterDelay:<#(NSTimeInterval)#>];

3

dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
double dealy = 3;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(dealy * NSEC_PER_SEC)), dispatch_get_main_queue, ^{
});

上一篇 下一篇

猜你喜欢

热点阅读