CGContextSaveGState: invalid context 0x0. If you want to see the backtrace

Xcode报错:CGContextSaveGState: invalid context 0x0. If you want to see the backtrace

猜测原因: 和CG开头相关的内容肯定是和视觉相关的内容。我的问题是有一个端口进程会扫描UIWindow下所有UIView的子类,结果这个进程卡住不扫描了,仔细检查,原来是重写UIControl时忘记给frame了

解决方法:检查与视觉相关的属性,例如frame,查看是否符合条件或不为空

猜你喜欢

转载自blog.csdn.net/kicinio/article/details/128070447