0

I am making an easy music player, and I have a UISlider as it's progress bar. Upon music starts, I fire a timer (0.01 interval) to notify the slider and make the slider change it's value accordingly.

Everything goes well except while the slider's superview (in this case a scrollview) is moving, the slider keeps still even though the timer is working well.

How can I fix it?

1 Answers1

1

By default, NSTimers won't fire when a scroll view is scrolling. You have to add the timer to the mainRunLoop for NSRunLoopCommonModes:

    [[NSRunLoop mainRunLoop] addTimer:yourTimer forMode:NSRunLoopCommonModes];
cncool
  • 1,015
  • 11
  • 12