In the subclass of the view manager you have, add ivar with the type of your subclass of NSView . Declare a property on it and mark it as an output.
// ViewControllerSubclass.h ViewType *myView; @property(readwrite, assign) IBOutlet ViewType *myView; // ViewControllerSubclass.m @synthesize myView;
Now that you have an outlet, plug it into a view developed through IB. To do this, right-click in IB on a subclass of the view controller (file owner), you should see the output in the list.
Once you do this, you can now send messages to the view in your code.
To mark a view when redrawing is necessary:
[myView setNeedsDisplay:YES]
user971401
source share