• 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: NSThread call back...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSThread call back...


  • Subject: Re: NSThread call back...
  • From: Dustin Voss <email@hidden>
  • Date: Wed, 9 Nov 2005 22:02:37 -0800

The message you send to the creator, you have to decide what thread context it should be executed in.

If it does UI, directly or indirectly, it should be executed in the main thread's context. If it just adjusts data values, it can be executed in any thread context, but you'll have to provide some sort of locking mechanism if you don't use the main thread context.

As to the mechanics of sending the message, the easiest ways are to use -performSelectorOnMainThread if executing on the main thread, a normal call if executing on the same thread, or the InterThreadMessaging library if executing on a thread other than the main thread (http://www.cocoadev.com/?InterThreadMessaging).

On 9 Nov 2005, at 9:25 AM, Brian O'Brien wrote:

When an NSThread wishes to communicate with the object that created it,
how can one arrange that the thread calls a method of the creator class?


Is this one possible use of the withObject parameter of the NSThread detechNewThreadSelector method?
If so what is the syntax for passing the method as a parameter?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSThread call back...
      • From: Chris Hanson <email@hidden>
References: 
 >NSThread call back... (From: "Brian O'Brien" <email@hidden>)

  • Prev by Date: .Mac (DotMac) SDK questions
  • Next by Date: Re: NSThread call back...
  • Previous by thread: Re: NSThread call back...
  • Next by thread: Re: NSThread call back...
  • Index(es):
    • Date
    • Thread