开发者

How to stop a NSThread in iphone? [duplicate]

开发者 https://www.devze.com 2023-01-05 03:01 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How to exit NSThread I have called a method using NSthread. I want to stop the thread on a click event of
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to exit NSThread

I have called a method using NSthread. I want to stop the thread on a click event of button. How can 开发者_如何学编程I achieve that?

[NSThread detachNewThreadSelector:@selector(playVideo) toTarget:self withObject:nil]; 


Try the the documentation for Threading, or better yet use NSOperation to perform the playVideo maintain a reference to the operation in your viewController and send a cancel message to the operation. Refer to the documentationNSOperation documentation

0

精彩评论

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