Adding a Timer to a Thread
Adding a Timer to a Thread
- Subject: Adding a Timer to a Thread
- From: Andreas Grosam <email@hidden>
- Date: Tue, 26 May 2009 20:15:19 +0200
What would you suggest is the preferred way to add a timer to a
different running thread?
Normally, I would use:
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
[runLoop addTimer:aTimer forMode:NSDefaultRunLoopMode];
However, this requires that it will be invoked from the context of the
target thread. How do I get the runLoop for any other than the current
thread?
Guess, I have to use
performSelector:onThread:withObject:waitUntilDone:modes:
Thanks for hints.
Regards
Andreas
_______________________________________________
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