NSThread停止/暂停

问题描述:

我在我的应用程序中创建了NSThread实例。过了一段时间后,我想暂停一下。有没有办法如何做到这一点。我想这样做,NSThread停止/暂停

如果([MyThread的isFinished]!){

MyThread的=零;

}

但仍然我不能阻止该线程。

+0

使用本[线索取消]。 – Ron

[NSThread sleepForTimeInterval:TIME_TO_PAUSE_THREAD]; 

OR

你必须使用的NSOperation队列相同

下面的链接可能是有用的,以你

http://developer.apple.com/library/ios/#samplecode/ThreadedCoreData/Listings/Classes_ParseOperation_h.html#//apple_ref/doc/uid/DTS40010723-Classes_ParseOperation_h-DontLinkElementID_5

+0

谢谢尼克希尔。其实我认为sleepForTimeInterval不适用于我的线程对象。我在一些地方使用了你的代码,它工作。 – JiteshW