title: Initialize a view with a xib
body: <p>I want to initialize a view with an xib. That is a UIView. So I have a xib and a UIView subclass with the init code pasted below (initWitFrame nibName). I feed the xib name to the init code from a view controller when creating the view.</p>
  
  <pre><code>SubclassUIView *view = [[SubclassUIView alloc]initWithFrame:self.view.bounds nibName:@"xibName"];
  </code></pre>
  
  <p>Am I on the right track? So far the contents of the xib does not load with the view.</p>
  
  <p>By the way the main view in the xib is set to be the class type of my UIView subclass.</p>
  
  <pre><code>- (id)initWithFrame:(CGRect)frame nibName:(NSString*)nibName
  {
      self = [super initWithFrame:frame];
      if (self)
      {
          [[NSBundle mainBundle] loadNibNamed:nibName owner:self options:nil];
          [self addSubview:self.view];
      }
      return self;
  }
  </code></pre>