NSTextView not refreshed properly on scrolling

Have you set the setDrawsBackground and copiesOnScroll propertes for either the NSScrollView or the NSClipView?

The first thing I would suggest is turning off the "draws background" property of the NSScrollView:

[myScrollView setDrawsBackground:NO];

Note that this should be set on the NSScrollView, and not on the embedded NSClipView.

The following excerpt from the documentation may be relevant:

If your NSScrollView encloses an NSClipView sending a setDrawsBackground: message with a parameter of NO to the NSScrollView has the added effect of sending the NSClipView a setCopiesOnScroll: message with a parameter of NO. The side effect of sending the setDrawsBackground: message directly to the NSClipView instead would be the appearance of “trails” (vestiges of previous drawing) in the document view as it is scrolled.


Looks like the text field isn't even in the scrolling-area... Are you sure something isnt overlapping it?