问题贴图:
查找问题方法:
Product -> Scheme -> Edit Scheme. Under the "Run" item, locate the "Arguments" tab, you'll see "Environmental Variables" in the tab, Add CG_CONTEXT_SHOW_BACKTRACE and set its value to YES.
再次运行项目,可以看到具体的定位信息
问题解决:
CGContextRef context = CGBitmapContextCreate (pixels, width, height, 8 , width * sizeof ( uint32_t ), colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedLast );
当context 为空时,系统会报出此错误。可以判断当context为空时,直接返回原有的image
if (context == NULL) {
return mage;
}
Fix it !