开发者

NSThread stop / pause

I have created a NSThread instance in my app. After some point I want to pause it. Is there any way how to do that. I tried doing,

if(![myThread isFinis开发者_如何学Pythonhed]) {

myThread = nil;

}

but still i m not able to stop that thread.


[NSThread sleepForTimeInterval:TIME_TO_PAUSE_THREAD];

OR

YOu have to use NSOperation queue for same

Following link may be usefull to you

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜