As soon as I embed my custom NSView in the scroll, nothing is drawn in my custom view.
To replicate the problem, I created a vanilla Cocoa application. I have subclassed NSView and its handler drawRect; I am doing something as simple as red fillRect. I verify that this works as expected:
- (void)drawRect:(NSRect)dirtyRect
{
[super drawRect:dirtyRect];
[[NSColor redColor] set];
[NSBezierPath fillRect:dirtyRect];
}
Back to IB, I click on my custom view, then go to the Editor> Paste> Scroll> menu .
Now I do not have a red rectangle. I checked that mine is drawRectno longer being called.
What gives?
It seemed to me that I found a solution here , but it did not help.
It seems so simple.
Xcode 5.0.2 OS10.9.1.