Is there anyway to get the setContentOffset animation to happen immediately instead of waiting until the app returns to the main run loop? I tried setting the animation property to NO and nesting inside of an animation block but it still waits until returning to the main run loop. I've also tried using a sub method to perform the animation. My problem is I perform some heavy work after setting the contentOffset so the scroll view waits until this work is complete to animate the setting of the content offset so it appears to lag for a second.
A:
No drawing will happen until the run loop gets time. If your heavy work does not need to be on the main thread then kick off another thread, otherwise schedule a timer with a time interval of 0 to perform the heavy work after the scroll view draws.
drawnonward
2010-04-28 17:12:16
A:
I moved the heavy work to scrollViewDidEndAnimation and it resolved my issue. The timer didn't work because my heavy work relies on the content offset position after the scrolling animation is finished and using the timer couldn't assure an accurate offset.
Jess
2010-04-29 03:55:09