Re: Sending an event from another thread
Re: Sending an event from another thread
- Subject: Re: Sending an event from another thread
- From: Nick Zitzmann <email@hidden>
- Date: Fri, 4 Jan 2008 17:36:09 -0700
On Jan 4, 2008, at 5:20 PM, Ivan Galic wrote:
I need to send a message from one thread to another, but I'd like to
put it in the standard event queue of the NSApp. My main thread is
running it's own message loop (nextEventMatchingMask....), and the
other thread needs to send it a message that it needs to do
something (open a window). I would like best if I could put a custom
NSEvent of some sort into the queue so that the main thread receives
it along with other events. Is this possible, and where should I
look for info? If not, what would be the best way to do it?
Use the -performSelectorOnMainThread:... methods in NSObject. You
don't need to use NSEvent to open a window; just send it the message
on the main thread to open.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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