2点の間に線を描きたい。ここに私のコードです。しかし、コンテキストメモリが02つの異なる点の間に線を描く
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 2.0);
CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
CGFloat components[] = {0.0, 0.0, 1.0, 1.0};
CGColorRef color = CGColorCreate(colorspace, components);
CGContextSetStrokeColorWithColor(context, color);
CGContextMoveToPoint(context, 0, 0);
CGContextAddLineToPoint(context, 300, 400);
CGContextStrokePath(context);
CGColorSpaceRelease(colorspace);
CGColorRelease(color);
どのような方法でこれを試していますか?、 – Vignesh
コンテキストメモリとは何ですか?あなたの 'context'変数が' nil'ではないと確信していますか? – Alexander
重複している可能性があります:http://stackoverflow.com/questions/1878821/how-to-draw-line-between-two-points – Devang