开发者社区 问答 正文

NSNotificationQueue和runloop的关系

NSNotificationQueue和runloop的关系

展开
收起
montos 2020-04-13 19:37:52 2053 分享 版权
1 条回答
写回答
取消 提交回答
  • NSNotificationQueue将通知添加到队列中时,其中postringStyle参数就是定义通知调用和runloop状态之间关系。

    该参数的三个可选参数:

    • NSPostWhenIdle:runloop空闲的时候回调通知方法
    • NSPostASAP:runloop在执行timer事件或sources事件完成的时候回调通知方法
    • NSPostNow:runloop立即回调通知方法 参考这篇文章
    2020-04-13 19:38:04
    赞同 展开评论
问答地址: