Re: NSAlert & NSOpenPanel on a background thread
Re: NSAlert & NSOpenPanel on a background thread
- Subject: Re: NSAlert & NSOpenPanel on a background thread
- From: Jens Alfke <email@hidden>
- Date: Thu, 22 May 2014 08:41:17 -0700
On May 22, 2014, at 8:29 AM, edward taffel <email@hidden> wrote:
> this i have remedied. however, given the scenario where a url has vanished, i first show an NSAlert & then an NSOpenPanel to offer relink. NSOpenPanel causes no such background thread issue: do the two have variant thread safety? or is this likely to change in the future for NSOpenPanel, as well?
I suspect NSOpenPanel just doesn’t have special code to detect misuse. It probably happens so often with NSAlert that they added a warning for it.
In general, you shouldn’t call _any_ AppKit code from a background thread. Ditto for any other UI-level framework that uses AppKit. (There are some exceptions, like working with offscreen NSImages, but in general the Apple API docs will tell you when an API is thread-safe.)
—Jens
_______________________________________________
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