title: Proper use of loadView and viewDidLoad with UIViewController without nibs/xibs
body: <p>When I program without a nib, I am under the impression that I need to call loadView to initialize my view, like this:</p>
  <pre><code>- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nil bundle:nil];
      if (self) {
          // Custom initialization
          [self loadView];
      }
      return self;
  }
  </code></pre>
  <p>(I have set nibNameOrNil = nil, since there is not nib.)</p>
  <p>Then, I set up the view, like this:</p>
  <pre><code>- (void) loadView {
      self.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 367)];
      [self viewDidLoad];
  }
  </code></pre>
  <p>This is do everything else in viewDidLoad.</p>
  <p>I'm still unsure if I am supposed to make the calls to loadView and viewDidLoad in this way. They are not getting called automatically.</p>
  <p>What is confusing is in the documentation for the UIViewController class reference:</p>
  <blockquote>
  <p>loadView Discussion</p>
  <p><strong>You should never call this method directly.</strong> The view controller calls
  this method when the view property is requested but is currently nil.
  <strong>If you create your views manually, you must override this method and
  use it to create your views.</strong> If you use Interface Builder to create
  your views and initialize the view controller—that is, you initialize
  the view using the initWithNibName:bundle: method, set the nibName and
  nibBundle properties directly, or create both your views and view
  controller in Interface Builder—then you must not override this
  method.</p>
  </blockquote>
  <p>So, I don't understand how loadView gets called if I should never call it directly.</p>
  <blockquote>
  <p>The default implementation of this method looks for valid nib
  information and uses that information to load the associated nib file.
  <strong>If no nib information is specified, the default implementation creates
  a plain UIView object and makes it the main view.</strong></p>
  </blockquote>
  <p>I don't understand how that works -- the creation of a pain UIView.</p>
  <blockquote>
  <p>If you override this method in order to create your views manually,
  you should do so and assign the root view of your hierarchy to the
  view property. (The views you create should be unique instances and
  should not be shared with any other view controller object.) Your
  custom implementation of this method should not call super.</p>
  <p>If you want to perform any additional initialization of your views, do
  so in the viewDidLoad method. In iOS 3.0 and later, you should also
  override the viewDidUnload method to release any references to the
  view or its contents.</p>
  </blockquote>
  <p>Okay, so far it doesn't say how viewDidLoad is called. So for viewDidLoad:</p>
  <blockquote>
  <p>viewDidLoad Discussion</p>
  <p><strong>This method is called</strong> after the view controller has loaded its
  associated views into memory. <strong>This method is called regardless</strong> of
  whether the views were stored in a nib file or created
  programmatically in the loadView method. This method is most commonly
  used to perform additional initialization steps on views that are
  loaded from nib files.</p>
  </blockquote>
  <p>Called by what?</p>
  <p>Since These methods are not getting called automatically in my code, I am left to think that I have to call them myself. But I still don't get a clear understanding form the documentation that this is the right thing to do.</p>