Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Cinder6

macrumors 6502a
Original poster
Jul 9, 2009
510
51
I have an NSScrollView with a custom NSView subclass in it (created from IB). It draws just fine, but if I set the content view to scroll to the top, then call the scroll view's reflectScrolledClipView: method, it performs the scroll, but doesn't show the contents of the view. I have to either scroll down slightly, or resize the window.

I've tried setNeedsDisplay on the NSView subclass itself, the content view, the scroll view, and the document view, all to no effect. Is there something else I need to do?
 
I do not know if it helps.

1. I usually call the setNeedsDisplay every place where I do make any changes on the view.
2. The setNeedsDisplay has to be called in the same class where we have over written the drawRect method. Other way the redraw will not be executed immediatly.
3. Try to use debugger and see if the setNeedsDisplay has been called.

BR
/petron
 
I've confirmed setNeedsDisplay is being called, and I put an NSLog in drawRect: -- it isn't getting called. Even if I call display explicitly, it's still not getting called. How do I force an NSView to display?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.