I have a context that needs to be around for the life of my app because it is a buffer that I continuously render images into. It is created using CGBitmapContextCreate
on my main thread when the app launches.
Is it safe to later call the following code from a background thread in an NSOperation?
CGImageRef imageRef = [[UIImage imageWithContentsOfFile:[fileURL path]] CGImage];
if (imageRef)
{
// Draw the base image to the bitmap context
CGContextDrawImage(myContext, myRect, imageRef);
}