• 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: performSelectorOnMainThread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performSelectorOnMainThread


  • Subject: Re: performSelectorOnMainThread
  • From: Joseph Kelly <email@hidden>
  • Date: Wed, 26 Oct 2005 08:56:24 -0700


On Oct 26, 2005, at 8:08 AM, j o a r wrote:


On 26 okt 2005, at 17.02, Luc Vandal wrote:


I have a question regarding performSelectorOnMainThread. If I do:
[myObject performSelectorOnMainThread:@selector(myFunction:) withObject:nil waitUntilDone:YES], does that mean that myFunction from myObject will be executed?



Yes.


If so, I tried that and the app will just hang on performSelectorOnMainThread. My function will never get called. If I set waitUntilDone:NO, then my function will eventually get called. Is it a problem with my secondary thread?


The "performOnMainThread" methods depends on that your main thread is idle from time to time, allowing the run loop to process events from run loop sources.

You can tell what your main thread is doing by running the Sampler application which ships with CHUD tools. If your main thread is blocked (i.e. waiting on an NSLock that's being held by the secondary thread), your app will become deadlocked.


joe


_______________________________________________ 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: performSelectorOnMainThread
      • From: j o a r <email@hidden>
References: 
 >performSelectorOnMainThread (From: Luc Vandal <email@hidden>)
 >Re: performSelectorOnMainThread (From: j o a r <email@hidden>)

  • Prev by Date: Re: NSPanel vs. NSFontPanel and font color
  • Next by Date: Re: problem unit testing core data
  • Previous by thread: Re: performSelectorOnMainThread
  • Next by thread: Re: performSelectorOnMainThread
  • Index(es):
    • Date
    • Thread