I don’t know why, but the statistics of this blog says that there are lots lof people who have interest in sleep function in Cocoa. Probably a same guy keeps visiting my blog for this.
Well, I don’t know what is so special about sleep.
Mac OS X is UNIX. So, you can use any standard library functions like sleep(), usleep() and nanosleep(). Also, NSThread provides Cocoa-level sleep facility.
- + (void)sleepForTimeInterval:(NSTimeInterval)ti
- + (void)sleepUntilDate:(NSDate *)aDate
Posted by Alexander Jäger on October 12, 2009 at 11:33 AM
iPhone sleep usleep sleepForTimeInterval NSTimer…
3 Möglichkeiten eine iPhone Anwendung zu pausieren:
[NSThread sleepForTimeInterval:5];
sleep(5);
usleep(5000000);
Alle 3 Anweisungen bewirken das gleiche Ergebniss, die Anwenudng wird schlafen gelegt. nachteil aller Optionen: die Anwendung wird wirklic…
Posted by Arthur Dent on August 26, 2010 at 11:01 PM
I’m actually interested in knowing how eating cocoa affects sleep, not about the sleep function in Cocoa. Seriously. :)
Posted by jongampark on August 27, 2010 at 7:30 AM
Whatever the effect is, just avoid eating it before going to bed without brushing your teeth. :)
Posted by Krishnan on November 26, 2010 at 12:53 AM
Funny one.:)
Posted by gosha on February 19, 2011 at 7:18 AM
haha, thanks ;)