Re: Continue application processing with mouse down on a menu
Re: Continue application processing with mouse down on a menu
- Subject: Re: Continue application processing with mouse down on a menu
- From: Scott Ribe <email@hidden>
- Date: Sun, 27 Sep 2015 08:44:07 -0600
On Sep 26, 2015, at 12:00 PM, Programmingkid <email@hidden> wrote:
>
> I did try using a separate thread, but that caused part of the application to stop responding to events.
A background thread will *not* cause your application to stop responding to events. You need to go back and look more closely at what was happening there.
Did you block on the main thread waiting for the background thread to finish? Of course waiting in the main thread would stop event processing, so you would need to post an event from the background thread when it is done, not block on the main thread. (Alternatively, you could have the main thread somehow check periodically if the bg thread is done, but in most cases calling performSelectorOnMainThread from the bg thread is a very easy way to get results back into the main thread, much easier than having the main thread "poll", and worrying about correct synchronization of that polling.)
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice
_______________________________________________
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