苹果文档指出,通常Quartz2D是thread-safe。但是,在NSOperation期间绘制到图像上下文时,我遇到了崩溃(EXC_BAD_ACCESS)。iPhone上的螺纹图
这是我的当前设置:
UIGraphicsBeginImageContext(imageSize);
CGContextRef context = UIGraphicsGetCurrentContext();
// drawing code
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
我怀疑崩溃都与当前上下文作为UIGraphicsGetCurrentContext实况指出,它需要从main thread调用。它是否正确?有没有其他方法来获取图像上下文?
不,这是不正确的,文件决定谎言给你的纯粹的乐趣... – 2009-10-04 20:12:04