Wednesday, 16 January 2019

Why does an activity indicator still spin when an app is paused?

I created a simple application with just a button and an activity indicator. When I press the button I have the activity indicator start animating. In Xcode 4.6 iPhone 6.1 Simulator I see the activity indicator spinning. When I pause the application I sometimes land in libsystem_kernel.dylib`mach_msg_trap. This appears to be on the com.apple.main-thread which is thread 1. Shouldn't pausing the app this way block the main thread and so stop the activity indicator from spinning? It doesn't appear to.

Update: This article ( http://www.dragthing.com/blog/2009/07/how-to-make-your-iphone-app-launch-faster/ ) says "As I discovered, the UIActivityIndicatorView animation is run on a thread by the system – that means, even though my application is blocked inside its initialisation code while it starts up, the spinner will still be spinning." Is it possible the UIActivityIndicatorView is animated off the main thread?



from Why does an activity indicator still spin when an app is paused?

No comments:

Post a Comment