title: UIViewController with Nib File and Inheritance
body: <p>I'm trying to do something really tricky and I'm still stuck at a point. I'm attempting to instance an <code>UIViewController</code> with a Nib file inherited from an other <code>UIViewController</code> with an other Nib file.<br>
  The problem is when I instantiate my son <code>UIViewController</code> .</p>
  
  <pre><code>// SonViewController
  - (id)initWithNibName:(NSString *)nibNameOrNil 
                  bundle:(NSBundle *)nibBundleOrNil
  {
      if ((self = [super initWithNibName:nibNameOrNil 
                                  bundle:nibBundleOrNil])) {
          // Custom initialization.
      }
      return self;
  }
  </code></pre>
  
  <p>The init method <code>initWithNibName:bundle:</code> should call the <code>super class</code> but it only call its own nib file. In the super class, I tried to override the <code>initWithNibName:bundle:</code> method and put the nibName myself like that :</p>
  
  <pre><code>// MotherViewController
  - (id)initWithNibName:(NSString *)nibNameOrNil 
                 bundle:(NSBundle *)nibBundleOrNil
  {
      if ((self = [super initWithNibName:@"MotherViewController" 
                                  bundle:nibBundleOrNil])) {
          // Custom initialization.
      }
      return self;
  }
  </code></pre>
  
  <p>It only init and display the <code>Mother Class</code> and its IB Object. I understand why but I begin thinking it is impossible to do what I want. Any suggestion ?</p>
  
  <p>Edit:<br>
  I would use my SonViewController just like that :</p>
  
  <pre><code>SonViewController *son = [[SonViewController alloc] 
                        initWithNibName:@"SonViewController" bundle:[NSBundle mainBundle]];
  
  [self.navigationController pushViewController:son animated:YES];
  [son release];
  </code></pre>
  
  <p>It should display son and mother IB Object...</p>
  
  <p>Regards,<br>
  kl94</p>