title: (iphone) How to create UIImage from imageRef which is created in background thread?
body: <p>UIImage* img = [UIImage imageWithCGImage: imageRef];<br>
  can be done in main-thread only.. bah..  </p>
  
  <p>Now all my image create functions which are to be run in background thread has to be modified.<br>
  Question is how should I change the above line.  </p>
  
  <p>Usual steps of creating image were as below.</p>
  
  <pre><code>CGImageRef imageRef = CGBitmapContextCreateImage(context);
  UIImage* img = [UIImage imageWithCGImage: imageRef];
  CGImageRelease(imageRef);
  
  CGContextRelease(context);
  
  return img;
  </code></pre>
  
  <p>If performSelector returned a value, it would be rather easy.<br>
  But it's not. Since this seems rather common requirement, I wonder if there are preferable practice of doing this. </p>
  
  <p>Thank you</p>