Subclassing an NSScrollView's DocumentView

175 Views Asked by At

How can one subclass an NSScrollView's DocumentView in order to do some custom drawing? I need to do some work with NSShadow inside of the scroll view.

1

There are 1 best solutions below

0
Monolo On BEST ANSWER

The document view is just a normal view (subclass of NSView,) so all you have to do is to create a view, either programmatically or in Interface Builder, and set the scroll view's documentView property to the new view.

You can set the property in a suitable awakeFromNib method, for instance.