Hi
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
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ModelThumbnailView" nib but the view outlet was not set.'
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.
Any ideas why?
Edit
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!!!
**Posting the code in case it helps **
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
This is the viewDidLoad of the MyThumbnailViewController class. The control never reaches here
- (void)viewDidLoad {
self.navigationItem.title = imageName;
self.navigationItem.hidesBackButton = NO;
[[self navigationController] setNavigationBarHidden:NO];
}
I removed the custom init method but still getting the same error.
SOLVED
Just created the whole thing again and now it works fine, though I don't see ANY differences in both the things!