Re: Progress bar problems on server persist
Re: Progress bar problems on server persist
- Subject: Re: Progress bar problems on server persist
- From: Graham Cox <email@hidden>
- Date: Fri, 06 May 2016 09:28:12 +1000
> On 6 May 2016, at 1:35 AM, Ken Thomases <email@hidden> wrote:
>
> Well, you're not supposed to call -setNeedsDisplay: from a background thread, either.
>
> From <https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html#//apple_ref/doc/uid/10000057i-CH12-123427>:
>
> "If a secondary thread of an application wants to cause portions of the view to be redrawn on the main thread, it must not do so using methods like display, setNeedsDisplay:, setNeedsDisplayInRect:, or setViewsNeedDisplay:. Instead, it should send a message to the main thread or call those methods using the performSelectorOnMainThread:withObject:waitUntilDone: method instead."
It strikes me that if Apple made -setNeedsDisplay: thread-safe, it would clear a huge number of potential pitfalls and bugs. The actual update would still be on main, but at least you could be sure that setting a control’s value didn’t need to be shunted. I wonder why this hasn’t been done?
—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