Newbie Q.
In my MainViewController, which is the first visible view.
I have a Circle class (no XIB) which subclasses UIView and overrides the draw method to draw a circle. Hello-World simple.
In the MainViewController how do I add the custom class I wrote so that it appears programatically?
Do I need to do anything besides overriding the draw method in Circle?
ian
If you are not loading
MainViewController‘sviewproperty from the NIB file (it’s not connected to anything in interface builder), then I believe that you want to override the loadView method in MainViewController with something like:This will get called automatically at the right time so when MainViewController is created, the view can be added to the window as a subview by whatever instantiates MainViewController.