what is the iOS sleep function

2020-08-09 06:01发布

问题:

I am looking for a function that puts a thread to sleep on iOS for c++ code, or even objective-c code, sleep(0) is not recognized by my compiler

Thanks,

回答1:

Block for .5 seconds:

[NSThread sleepForTimeInterval:.5];