use*_*003 4 ios uigraphicscontext
这是我正在使用的代码摘录:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^
{
UIGraphicsBeginImageContextWithOptions(irect.size, YES, 0.0 );
CGContextRef context = UIGraphicsGetCurrentContext();
if (context == 0)
NSLog (@"Null Graphics Context") ;
else
NSLog (@"OK") ;
. . . .
// Various drawing functions
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}) ;
Run Code Online (Sandbox Code Playgroud)
我发现每次调用UIGraphicsGetCurrentContext都会返回NULL.我在控制台上收到此消息.
CGContextRestoreGState:无效的上下文0x0.这是一个严重的错误.该应用程序或其使用的库正在使用无效的上下文,从而导致系统稳定性和可靠性的整体降低.此通知是礼貌的:请解决此问题.它将成为即将到来的更新中的致命错误.
什么会导致UIGraphicsGetCurrentContext返回无效的图形上下文?
| 归档时间: |
|
| 查看次数: |
4184 次 |
| 最近记录: |