Re: Open a panel in secondary thread?
Re: Open a panel in secondary thread?
- Subject: Re: Open a panel in secondary thread?
- From: Dave via Cocoa-dev <email@hidden>
- Date: Tue, 24 Mar 2020 21:51:41 +0100
Hi,
You may want to call performSelectorOnMainThread and pass YES as the wait until
done flag.
Cheer
Dave
> On 21 Mar 2020, at 20:05, Gabriel Zachmann via Cocoa-dev
> <email@hidden> wrote:
>
> Is it possible to open an NSOpenPanel in a secondary thread?
>
> I create the thread like this:
>
> directoryScanThread_ = [[NSThread alloc] initWithTarget: self
> selector:
> @selector(scanDirectory:)
> object: nil];
> [directoryScanThread_ start];
>
>
> But when I do:
>
> NSOpenPanel *oPanel = [NSOpenPanel openPanel];
>
> it crashes at this point.
>
> In the docs, I found a hint that one should use
>
> lockFocusIfCanDraw
>
> but that is deprecated now.
>
> Any ideas will be highly appreciated.
>
>
> Best regards, Gabriel
>
>
> _______________________________________________
>
> 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
_______________________________________________
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