![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
RunLoop
空中海
这个作者很懒,什么都没留下…
展开
-
RunLoop启动方法
- (void)run; // 默认模式- (void)runUntilDate:(NSDate *)limitDate;- (BOOL)runMode:(NSRunLoopMode)mode beforeDate:(NSDate *)limitDate;第一种会一直运行下去,并且一直在NSDefaultRunLoopMode模式下,重复调用runMode:beforeDate:方法。原创 2018-02-07 13:53:02 · 573 阅读 · 0 评论 -
NSRunLoop的退出方式
一. 启动RunLoop 通过[NSRunLoop currentRunLoop]或者CFRunLoopGetCurrent()方式可以获取当前线程的runloop。根据苹果文档,启动一个runloop有以下三种方法:- (void)run; - (void)runUntilDate:(NSDate *)limitDate;- (void)runMode:(NSString *)m转载 2018-02-07 16:10:15 · 208 阅读 · 0 评论 -
RunLoop总结
RunLoop总览RunLoop指的是NSRunloop(基于foundation框架)或者CFRunloopRef(基于core foundation框架),CFRunloopRef是纯C的函数,而NSRunloop仅仅是CFRunloopRef的OC封装,并未提供额外的其他功能。可以将runloop理解为一个处理消息循环的对象,有消息时就处理,没有消息的时候就休眠。两者是可以相互转原创 2018-02-07 16:40:51 · 306 阅读 · 0 评论