Re: dispatch_sync(dispatch_get_main_queue() UI weirdness
Re: dispatch_sync(dispatch_get_main_queue() UI weirdness
- Subject: Re: dispatch_sync(dispatch_get_main_queue() UI weirdness
- From: Nivek Research <email@hidden>
- Date: Sat, 06 Sep 2014 13:46:13 -0400
> Rarely do I suggest performSelector: but it happens to work here. I’d love to know more about why dispatch doesn’t work so well however.
It is only a slightly educated guess, but I suspect it is because the UI is queuing work as well. Running under Instruments shows a number of activities queued and they run only after the panel is closed. I suspect that either the modal run loop isn’t prepared to handle these requests itself or that AppKit has special considerations when performing runModalForWindow at event handling time that it doesn’t handled when performing queued GCD or NSOperation work. Apple’s documentation on what can or should be done within work queued to the main dispatch queue or NSOperationQueue’s main queue is very limited. However, my experience suggests that not all UI tasks can be performed from these points in the run loop.
—kevin
_______________________________________________
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