美文网首页
dispatch timer

dispatch timer

作者: ericguo | 来源:发表于2017-04-19 11:17 被阅读41次

1. dispatch_source_create创建一个定时器消息源

2. dispatch_source_set_timer   设置定时器

dispatch_source_set_event_handler 设置事件处理

3.dispatch_resume启动定时器

4.要更改定时器间隔,多次调用dispatch_source_set_timer即可

5. 定时器会自动重复,取消定时器使用dispatch_source_cancel;

详情:Dispatch Source Timer 的使用以及注意事项

Git库:testGCD

相关文章

网友评论

      本文标题:dispatch timer

      本文链接:https://www.haomeiwen.com/subject/jvevottx.html