什么是Objective-C / Cocoa中Java的Thread.sleep()的等价物? [英] What's the equivalent of Java's Thread.sleep() in Objective-C/Cocoa?

查看:116
本文介绍了什么是Objective-C / Cocoa中Java的Thread.sleep()的等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Java中,您可以使用Thread.sleep()暂停当前线程的执行一段时间。在Objective C中有这样的东西吗?

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?

推荐答案

是的,有一个 + [NSThread sleepForTimeInterval:]

(Just因此,您知道将来的问题,Objective-C是语言本身;对象库(至少其中一个)是Cocoa。)

(Just so you know for future questions, Objective-C is the language itself; the library of objects (one of them at least) is Cocoa.)

这篇关于什么是Objective-C / Cocoa中Java的Thread.sleep()的等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆