0

i noticed that when i hold UIPicker on selection, than all my timers pauses.

I have global timer like clock which is executed every second. However when i hold picker it's pauses all timers in app stops.

Maybe some one had this problem and have a solution ?

Thank you

4

1 回答 1

0

如果你的计时器应该运行而不管你的 UI 中发生了什么,你应该在后台线程上运行它。

当然,计时器会创建自己的后台进程来进行计数。但是如果你在主线程上创建它,那么如果 UI 被阻塞,回调选择器可能会被阻塞,就像持有UIPickerView.

只需在全局队列上启动计时器并在主队列上向 UI 发送消息。

于 2013-01-21T12:41:54.680 回答