What's the equivalent of Java's Thread.sleep() in Objective-C/Cocoa?

后端 未结 6 445
野的像风
野的像风 2020-12-23 15:45

In Java you can suspend the current thread\'s execution for an amount of time using Thread.sleep(). Is there something like this in Objective-C?

6条回答
  •  不知归路
    2020-12-23 16:25

    Of course, you could also use the standard Unix sleep() and usleep() calls, too. (If writing Cocoa, I'd stay with the [NSThread sleepForTimeInterval:], however.)

提交回复
热议问题