Re: Progress bar problems on server persist
Re: Progress bar problems on server persist
- Subject: Re: Progress bar problems on server persist
- From: Ken Thomases <email@hidden>
- Date: Thu, 05 May 2016 10:07:22 -0500
On May 5, 2016, at 9:55 AM, Steve Mills <email@hidden> wrote:
>
> On May 05, 2016, at 09:31 AM, Ken Thomases <email@hidden> wrote:
>
>> Where did the idea to use timers come from?
>
> From you, man! March 21. :) You also mentioned turning off the animation as one way of working around this problem. What's the best way to do that?
Well, my only suggestion was to set usesThreadedAnimation to NO. It may be that that causes Cocoa to use a timer internally, but you shouldn't be doing anything explicit with a timer with respect to the progress indicator.
>> This doesn't look like the main thread. Why is anything involving a progress indicator happening on a non-main and non-private-to-AppKit thread? Are you manipulating the GUI from background threads (like setting the progress bar's value)?
>
> The value can get set from non-main threads, as well as the indeterminate property.
Don't do that. You must always shunt such work to the main thread.
>> Also, if you run a run loop to wait for some specific source — as RRD`-[RESTClient sendRESTCall:] appears to be doing — you should basically always schedule that source on a private mode and run the run loop in that mode. That prevents any other unknown sources from firing.
>
> Hmmm. This particular method is waiting for the REST result to be sent back, so it just loops with [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; until a flag has changed. Again, I didn't write this. Well mess with using a private mode instead.
OK, but if you don't stop manipulating the progress indicator from the background thread, then doing so may also prevent the progress indicator from updating. It appears to be scheduling its redisplay on the thread from which its properties were updated, probably in the common modes.
Regards,
Ken
_______________________________________________
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