• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: dispatch_sync(dispatch_get_main_queue() UI weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Job postings at Cocoa mailing list
  • Next by Date: Re: About the Bundle creator OS Type code
  • Previous by thread: Re: documentClassForType:typeName is dynamic type instead of my declared type
  • Next by thread: Re: About the Bundle creator OS Type code
  • Index(es):
    • Date
    • Thread