This is for MacOS not iOS.

If your running code on a GCD queue

dispatch_sync(dispatch_get_main_queue(), ^{
   //do UI stuff
});

is pretty much the way to do UI stuff on the main thread/queue which seems to 
work well for iOS. MacOS seems to be a different story. Try this for a simple 
example

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
   dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 
0), ^{

       // So my app is doing some background stuff
       // and I need a file from the user so

       // code blah blah code

       dispatch_sync(dispatch_get_main_queue(), ^{
           NSOpenPanel *op = [NSOpenPanel openPanel];

           [op runModal];
       });

       // resume code blah blah code
   });
}
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. I'm 
just using the NSOpenPanel here as an example, this also happens with any view 
that contains a scroll view (so I've tested so far). Is this a bug? Are others 
seeing this or is it just me and is there another preferred way of doing this?
_______________________________________________

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