NSThread停止/暂停
问题描述:
我在我的应用程序中创建了NSThread实例。过了一段时间后,我想暂停一下。有没有办法如何做到这一点。我想这样做,NSThread停止/暂停
如果([MyThread的isFinished]!){
MyThread的=零;
}
但仍然我不能阻止该线程。
答
[NSThread sleepForTimeInterval:TIME_TO_PAUSE_THREAD];
OR
你必须使用的NSOperation队列相同
下面的链接可能是有用的,以你
+0
谢谢尼克希尔。其实我认为sleepForTimeInterval不适用于我的线程对象。我在一些地方使用了你的代码,它工作。 – JiteshW
使用本[线索取消]。 – Ron