Re: performSelectorOnMainThread
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