/* 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);
Arriba está el código que estoy tratando de resolver. Se supone que debe hacer lo que CGContext dice que hace, pero no estoy obteniendo nada. sigo recibiendo este error:error 'contexto no válido 0x0' al utilizar funciones CGContext *
Fri Oct 28 13:18:40 case.app testApplication[4127] <Error>: CGContextSetRGBStrokeColor: invalid context 0x0
Fri Oct 28 13:18:40 case.app testApplication[4127] <Error>: CGContextSetLineWidth: invalid context 0x0
Fri Oct 28 13:18:40 case.app testApplication[4127] <Error>: CGContextBeginPath: invalid context 0x0
Fri Oct 28 13:18:40 case.app testApplication[4127] <Error>: CGContextAddLineToPoint: invalid context 0x0
Fri Oct 28 13:18:40 case.app testApplication[4127] <Error>: CGContextDrawPath: invalid context 0x0
me refiero a la CGContextRef en mi archivo de cabecera.
no creo que entienda CGContext lo suficientemente bien ni sé lo que CGContextRef debería ser.
¿Dónde vive este código? En el 'drawRect' de una subclase' UIView' – MusiGenesis
'- (void) userShow {' –
¿Qué diablos es eso? ¿Qué hace? ¿Lo llama '-drawRect:'? –