PDFView setNeedsDisplay:YES doesn't work on MacOS Sierra 10.12
<p>I have use <code>[PDFView setNeedsDisplay:YES]</code> to let the PDF view redraw, and it worked great on OSX 10.9-10.11. 
However it doesn't work unless I zoom in or zoom out the PDF page...  </p>

<p>Is there any other way to redraw immediately? Code below:</p>

<pre><code>NSRect      newBounds;
NSRect      currentBounds;
NSRect      dirtyRect;
NSPoint     mouseLoc;
NSPoint     endPt;

// Where is annotation now?
currentBounds = [_activeAnnotation bounds];

// Mouse in display view coordinates.
mouseLoc = [self convertPoint: [theEvent locationInWindow] fromView: NULL];

// Convert end point to page space.
if(activePage == nil)
    activePage =[_activeAnnotation page];

_LinePoint= [self convertPoint: mouseLoc toPage: activePage];
endPt = [self convertPoint: mouseLoc toPage: activePage];
if(_selectedIdx == 3) //ink
{
    [(PDFAnnotationInk*)_activeAnnotation removeBezierPath:_path];

    //endPt.x=_xPoint.x; //竖线
    //endPt.y=_xPoint.y; //横线

    [_path lineToPoint:endPt];  //  普通笔

    [(PDFAnnotationInk*)_activeAnnotation addBezierPath:_path];

    [self annotationChanged];
    [self setNeedsDisplay:YES];

    return;
</code></pre>

<p><strong>UPDATE</strong>:</p>

<p>I found that the <code>setNeedsDispaly</code> calls the <em><code>drawPage:toContext:</code></em>   however the drawing code doesn't work in  <em><code>drawPage:toContext:</code></em> </p>

<pre><code>- (void)drawPage:(PDFPage *)pdfPage toContext(CGContextRef)context
{
    [super drawPage: pdfPage toContext:context];
    NSBezierPath *line=[NSBezierPath bezierPath];
    [line moveToPoint:_xPoint];
    [line lineToPoint:NSMakePoint(150, 150)];
    [[NSColor redColor] set];
    [line setLineWidth:50] ;
    [line stroke];
}
</code></pre>

<p>the debug said <code>CGContextSetFillColorWithColor: invalid context 0x0</code> and more <code>invalid context 0x0</code> warnings. 
What I do in the <code>drawPage:toContext:</code> is testing and just use BezierPath to draw a line. </p>