How to draw unaliased lines in Cocoa ?

I need unaliased hairline paths…

void CGContextSetShouldAntialias (CGContextRef context, bool shouldAntialias);
void CGContextSetAllowsAntialiasing(CGContextRef context, bool allowsAntialiasing);
(the later available only in Tiger and above)
Note that the anti-aliasing setting is not part of the graphic state and is unaffected by CGContextSaveGState and CGContextRestoreGState.
There is also a function to align a graphic object (size, point, rect) to the the device space coordiante system.

void CGContextConsert[Size | Point | Rect]ToDeviceSpace( CGContextRef context, [CGSize | CGPoint | CGRect] object);
And - latest but not least - a private Quartz function:
void CGContextSetStrokeAdjust(CGContextRef ctx, int zeroOrOne); (private Quartz API)
The API to adjust anti-aliasing belongs to Quartz: