Spinning the busy indicator
Spinning the busy indicator
- Subject: Spinning the busy indicator
- From: Graham Cox <email@hidden>
- Date: Thu, 30 Apr 2015 11:22:06 +1000
I have added a NSProgressIndicator to my UI with the circular “busy” style. It’s set to not display when stopped, and I simply start it using -startAnimation: and stop it using -stopAnimation:
The indicator shows and hides correctly, but most of the time it doesn’t actually spin. It does sometimes, but mostly it doesn’t. I’m wondering if there’s something I need to do to keep it going that I’m not doing (I’m not doing anything other than the above).
The app has a mostly idle main loop, and does most of its processing using an NSOperationQueue that I create myself, so all of its tasks are running on non-main threads. The busy indicator is stopped and started by these queues being given tasks and then finishing them (I keep track of how many I start and how many finish so that I know when the busy indicator needs to start and stop). The messages that trigger the UI are all sent on the main thread.
My guess is that the busy indicator is animated by a low-priority thread of its own, and the work being done by my queue has a higher priority so the animation thread never gets any time. Does that sound like a reasonable explanation? If so, is there any way to make sure that the spinner actually spins?
A related qustion is:
Is there a way to have a much larger white busy indicator that I can overlay over a view using NSProgressIndicator? The tiny little standard black one is a bit insignificant and a larger overlaid white one would be a better fit for this case.
—Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden