美文网首页
关于CGContextRef无效的问题

关于CGContextRef无效的问题

作者: 我是卖报滴小行家 | 来源:发表于2016-11-07 15:26 被阅读207次
    • 在实现CGContextRef制图的过程用,因为直接调用“[self drawRect:self.bounds]”出现啦如下错误:
    Nov  7 15:22:09 7777 PasswordDemo[15969] <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
    Nov  7 15:22:09 7777 PasswordDemo[15969] <Error>: CGContextBeginPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
    Nov  7 15:22:09 7777 PasswordDemo[15969] <Error>: CGContextSetLineWidth: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
    Nov  7 15:22:09 7777 PasswordDemo[15969] <Error>: CGContextSetLineCap: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
    Nov  7 15:22:09 7777 PasswordDemo[15969] <Error>: CGContextSetLineJoin: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
    Nov  7 15:22:09 7777 PasswordDemo[15969] <Error>: CGContextSetRGBStrokeColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
    Nov  7 15:22:09 7777 PasswordDemo[15969] <Error>: CGContextMoveToPoint: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
    

    🐷解决办法:
    其实在实现的制图过程中,我们不需要直接调用“[self drawRect:self.bounds]”,只要调用“[self setNeedsDisplay]”即可。

    相关文章

      网友评论

          本文标题:关于CGContextRef无效的问题

          本文链接:https://www.haomeiwen.com/subject/dpsouttx.html