iPhone - Why am I getting this error when the view mapping is correct?
<p>My iPhone app was running fine. I added a component to my xib file (an activity indicator). I have created my own init method and am using the XIB name in the init method. Now I get this error when I do a pushViewController</p>

<pre><code>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ModelThumbnailView" nib but the view outlet was not set.'
</code></pre>

<p>I know this usually crops up when the viewcontroller is not mapped to the view in the xib. But all mappings are fine. I even deleted the class and xib and created them again. The init method is also not returning a nil. But I still get the exception as soon as I call a pushViewController with the object of this class.</p>

<p>Any ideas why?</p>

<p><strong>Edit</strong></p>

<p>Was just debugging and called a method in the viewcontroller before calling a pushViewController on it. The debugger shows that the nib name is set properly, the bundle is nil (coz thats what am passing) but the view is also nil. No idea why!!!</p>

<p>**Posting the code in case it helps **</p>

<pre><code>MyThumbnailViewController *modCont = [[[MyThumbnailViewController alloc] initWithNibName:@"MyThumbnailView" bundle:nil] autorelease];
[modCont setImgName:imgName count:numOfValues andIndex:0];

[[self navigationController] pushViewController:modCont animated:YES]; //This gives the exception
</code></pre>

<p>This is the viewDidLoad of the MyThumbnailViewController class. The control never reaches here</p>

<pre><code>- (void)viewDidLoad {
    self.navigationItem.title = imageName;
    self.navigationItem.hidesBackButton = NO;
    [[self navigationController] setNavigationBarHidden:NO];
}
</code></pre>

<p>I removed the custom init method but still getting the same error.</p>

<p><strong><em>SOLVED</em></strong></p>

<p>Just created the whole thing again and now it works fine, though I don't see ANY differences in both the things!</p>
