IPhone carving

The apple documentation states that Quartz2D is generally thread safe . However, when accessing the image context during NSOperation, I get crashes (EXC_BAD_ACCESS).

This is my current setup:

UIGraphicsBeginImageContext(imageSize);
CGContextRef context = UIGraphicsGetCurrentContext();
// drawing code
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

I suspect that the crashes are related to the current context, as the UIGraphicsGetCurrentContext document states that it needs to be called from the main thread . It's right? Are there other ways to get the image context?

+3
source share
2 answers

. , UIGraphicsGetCurrentContext() , , . .

+3

UIGraphics - . CGGraphicsContext ; .

+4

Source: https://habr.com/ru/post/1719224/


All Articles