‘invalid context 0x0’ error when using CGContext* functions
/* Adding the Path */ UserGraphBuff = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(UserGraphBuff,5,10,0,1); CGContextSetLineWidth(UserGraphBuff, 2 ); CGContextBeginPath(UserGraphBuff); //line to last user point CGContextAddLineToPoint(UserGraphBuff, (*xVal)[sizeof xVal / sizeof *xVal - 1], (*yNewVal)[sizeof yNewVal / sizeof *yNewVal - 1]); //line to rest of user points in reverse order for (int i = sizeof xVal / sizeof *xVal - 1; i > -1; i--){ CGContextAddLineToPoint(UserGraphBuff, (*xVal)[i], (*yNewVal)[i]); } //EOFill CGContextEOFillPath(UserGraphBuff); Above is the code I am