Re: Can't perform selectors after delay in a secondary thread?
Re: Can't perform selectors after delay in a secondary thread?
- Subject: Re: Can't perform selectors after delay in a secondary thread?
- From: Bill Bumgarner <email@hidden>
- Date: Tue, 01 Sep 2009 22:41:05 -0700
On Sep 1, 2009, at 10:37 PM, Laurent Daudelin wrote:
I don't explicitly create one. However, from inside the beginning of
the method that runs in this secondary thread, I did print a trace
of the output of [NSRunLoop currentRunLoop] and I did get
information about the current runloop, which I assumed was set up
when I detached. Am I to assume that this loop is actually the main
run loop?
No -- you need to explicitly run the run loop for
performSelector:withObject:afterDelay: to work.
If the run loop isn't running, a bunch of things -- including that --
won't work.
If you create a thread like:
thread_fun() {
while(1) {
... wait for stuff ...;
... do things to stuff ...;
};
}
Then you aren't running a run loop.
b.bum
_______________________________________________
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