NSTimer在滚动过程中停止 [英] NSTimer stops during scrolling
本文介绍了NSTimer在滚动过程中停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在调试在XCode4
中开发的IOS
项目期间,我初始化并运行NSTimer
对象.但是,计时器在我按下滚动视图后立即停止,并且在释放滚动条后继续运行.
During debugging my IOS
project developed in XCode4
, I initialize and run an NSTimer
object. However, the timer stops as soon as I press the scroll view and it continues to run after I release the scroll.
是否存在NSTimer的配置,以便在滚动过程中不会阻止计时器?
Is there a configuration for NSTimer such that timer is not blocked during scrolling?
提前谢谢.
推荐答案
添加此行,然后重试
[[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
这篇关于NSTimer在滚动过程中停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文