NSTimer stops while scrolling

During debugging of my IOS project developed in XCode4 , I initialize and run the NSTimer object. However, the timer stops as soon as I click on the scroll view, and it continues to work after releasing the scroll.

Is there a configuration for NSTimer so the timer does not lock while scrolling?

Thanks in advance.

+4
source share
1 answer

Add this single line and try again.

 [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; 
+11
source

Source: https://habr.com/ru/post/1489259/


All Articles