UIImage * img = [UIImage imageWithCGImage: imageRef];
can only be done in main-thread .. bah ..
Now all my images create functions that must be executed in the background thread, must be changed.
The question is how to change the above line.
The usual steps for creating an image were as shown below.
CGImageRef imageRef = CGBitmapContextCreateImage(context); UIImage* img = [UIImage imageWithCGImage: imageRef]; CGImageRelease(imageRef); CGContextRelease(context); return img;
If performSelector returned a value, that would be pretty simple.
But this is not so. Since this seems like a pretty common requirement, I wonder if there is a preferred practice of this.
thanks
source share