-
timer要添加到RunLoop中才会开始工作
-
timerWithTimeInterval
创建的timer要手动添加到RunLoop中 -
scheduledTimerWithTimeInterval
创建的timer默认就已经以Default模式添加到当前RunLoop中,想转模式或添加到其他RunLoop中就得手动重新添加 -
timerWithTimeInterval
和scheduledTimerWithTimeInterval
都不是马上开始执行,是先过了间隔时间才开始第一次
timer要添加到RunLoop中才会开始工作
timerWithTimeInterval
创建的timer要手动添加到RunLoop中
scheduledTimerWithTimeInterval
创建的timer默认就已经以Default模式添加到当前RunLoop中,想转模式或添加到其他RunLoop中就得手动重新添加
timerWithTimeInterval
和scheduledTimerWithTimeInterval
都不是马上开始执行,是先过了间隔时间才开始第一次
本文标题:NSTimer的注意点
本文链接:https://www.haomeiwen.com/subject/eigrxhtx.html
网友评论