美文网首页
NSTimer的注意点

NSTimer的注意点

作者: 健了个平_24 | 来源:发表于2020-02-04 16:07 被阅读0次
    • timer要添加到RunLoop中才会开始工作

    • timerWithTimeInterval创建的timer要手动添加到RunLoop中

    • scheduledTimerWithTimeInterval创建的timer默认就已经以Default模式添加到当前RunLoop中,想转模式或添加到其他RunLoop中就得手动重新添加

    • timerWithTimeIntervalscheduledTimerWithTimeInterval都不是马上开始执行,是先过了间隔时间才开始第一次

    相关文章

      网友评论

          本文标题:NSTimer的注意点

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