title: (iphone) canceling thread of performSelectorInBackground
body: <p>I'm calling a function in another thread using performSelectorInBackground.  </p>
  
  <p>I'd like a "canceling" ability on the thread.<br>
  The selector is modifying a data, and canceling needs to maintain the data's integrity.<br>
  Main integrity on UIImages related operation, canceling the thread shouldn't leave UIImages corrupted.</p>
  
  <p>I can think of setting a boolean value, and the selector to check the bool value from time to time so that it can terminate the operation gracefully and inform the main thread of completion of terminating.  </p>
  
  <p>Is there something I can use to this end or am I onto implementing this on my own?</p>
  
  <p>Thank you</p>