开发者

Difference between NSThread and detachNewThreadSelector:toTarget:withObject:

开发者 https://www.devze.com 2022-12-27 21:34 出处:网络
In the NSThread documentation, I came across the method detachNewThreadSelector:toTarget:withObject:.

In the NSThread documentation, I came across the method detachNewThreadSelector:toTarget:withObject:. What's the difference between that method and creating a thread with initWithT开发者_C百科arget:selector:object: and then starting it with start?


The only difference is that the second way gives you a reference to the NSThread object, so you can do things like set the stack size or priority before starting it, or use the isExecuting/Finished/Cancelled methods to check its status later.

0

精彩评论

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