I couldn't found any line drawing primitive in Cocoa at NSView level. The only thing I've been found is NSBezierPath
. Is this a preferred way? Or is there another way which I couldn't discovered?
NSBezierPath
is exactly what you should be using. If you just want to draw a straight line from one point to another, use the class method:
+strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2