I have a subclass NSView foothat overrides drawRect:
- (void)drawRect:(NSRect)dirtyRect
{
[self doStuff];
}
I would expect that whenever I add an instance of barmy class as a subtitle of another view, barit would be redrawn. However, when I add baras the contentViewmain window in my application, I do not see this to be the case.
I tried adding another override:
- (void)viewDidMoveToSuperview
{
self.needsDisplay = YES;
}
... in the hope that when the barsupervisor receives it, it will invalidate its display and lead to redrawing. There is no such luck ( viewDidMoveToSuperviewcalled, but not drawRect:).
, , drawRect:, , . .
, : 1) drawRect:? 2) - - , cocoa?
foo, drawRect:, , : , NSTextView, , , NSScrollView. , , NSScrollView, foo drawRect.
, - NSScrollView foo drawRect:. Google , , , NSScrollView. , , -, subviews NSScrollView, NSScrollView.
, : NSScrollView drawRect:?