I have to draw lines few times. I do this now:
- (void)drawRect:(NSRect)dirtyRect
{
[NSGraphicsContext saveGraphicsState];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:point];
[[NSColor blackColor] set];
[path lineToPoint:point2];
[path stroke];
[NSGraphicsContext restoreGraphicsState];
}
And i call this from other class many time with other parameters:
[workspace setPoint1:someValue setPoint2:someOtherValue];
[workspace setNeedsDisplay:YES];
What i need?
I call this few times with changing parameters someValue
and someOtherValue
and I have to draw all lines and I want to see it. Now i see only last path. Where is the problem? How can i do this correctly?
Thank you.