NSThread sleepUntilDate
NSThread sleepUntilDate
- Subject: NSThread sleepUntilDate
- From: David Blanton <email@hidden>
- Date: Sat, 10 Jul 2004 11:02:54 -0600
Given this description of NSThread:
An NSThread object controls a thread of execution. Use NSThread when you
want to have an Objective-C method run in its own thread of execution or if
you need to terminate or delay the current thread.
I want to do some stuff then wait for an interval (20 seconds) before doing
the next instruction. Is sleepUntilDate the way to do this? In the old Mac
days you could use delay(...) at some point in the code. This is the
behavior for which I am looking.
NSDate * d = [NSDate dateWithTimeIntervalSinceNow:20]
NSThread * t = [NSThread currentThread];
[t sleepUntilDate:d]
// should this code wait here for 20 seconds before doing the next
//instruction?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.