title: How to exit NSThread
body: <p>I am using a thread like this,</p>
  
  <pre><code>[NSThread detachNewThreadSelector:@selector(myfunction) toTarget:self withObject
  </code></pre>
  
  <p>the thread is running correctly, I want to quit the thread in the middle,how can I do this.If I use [NSThread exit] the application is hanging.</p>