我想停止線程的執行。我使用「iscancelled」,但出現了一些問題。取消線程後,執行不會停止。如何停止執行iphone中的線程
NSLog(@"YES-------%d,%d", [myThread isExecuting], [myThread isCancelled]);//(OutPut--1,0)
[myThread cancel];
if([[NSThread currentThread] isCancelled])
{
[NSThread exit];
}
NSLog(@"YES-------%d,%d", [myThread isExecuting], [myThread isCancelled]);//(OutPut--1,1)
這怎麼可能,取消它的執行不會停止線程之後????
感謝,