• 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: Sending an event from another thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Sending an event from another thread (From: Ivan Galic <email@hidden>)

  • Prev by Date: Re: Image scaling
  • Next by Date: Re: Image scaling
  • Previous by thread: Sending an event from another thread
  • Next by thread: Open record in Address Book
  • Index(es):
    • Date
    • Thread