> On Sep 5, 2014, at 11:44 AM, Jonathan Guy <jonathan...@mac.com> wrote:
> 
> when the NSOpenPanel opens all kinds of weirdness is going on. The scroll 
> views scroll very erratically if at all and the directories don't list 
> properly. 

Well, you've blocked one of the threads that services the global dispatch queue 
— it's stuck in a dispatch_sync call that won't return until the user dismisses 
the open panel. I don't know exactly what kinds of problems blocking the queue 
will cause, but it's definitely not a good idea. (The problems you report sound 
more severe than what I would guess would happen, but I definitely don't know 
how concurrent dispatch queues are implemented.)

You should rewrite your code to use dispatch_async instead. Then when the modal 
session completes, call back to the global dispatch queue to finish running 
your code.

(And the whole scenario you're giving sounds like bad UI design — your code 
shouldn't suddenly pop up a modal panel just because you "need a file from the 
user". The user should be in control of tasks like opening files. But you may 
have created an unrealistic scenario just as an example…)

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to