I have an application with two windows, the main window opens the second window that is a NSWindowController
and in its xib
file there is a custom view
, is there any way to draw in this custom view
from NSWindowController
?
thanks
I have an application with two windows, the main window opens the second window that is a NSWindowController
and in its xib
file there is a custom view
, is there any way to draw in this custom view
from NSWindowController
?
thanks
Override - (void) drawRect:(NSRect) dirtyRect
in your custom NSView to do the drawing.
If you need to inform this drawRect method from your (custom) NSWindowController, you can use delegate or data source patterns by setting an outlet from the view to the NSWindowController.
solved, I have declared two IBOutlets
, one on NSView
:
IBOutlet MyNSWindowController *wc;
and one on NSWindowController
:
IBOutlet MyNSView *view;
then, I have to connected them to custom view
.
Now I can to use its methods simply calling its IBOutlets
.