I have a class called TaskListViewController and I am going to ShowTaskViewController. In the beginning in ShowTaskViewController I didn't have a view object I only Had a TableView object where I was dynamically loading data from a database and it worked fine.
Now I deleted the TableView object in ShowTaskViewController class and I dragged and dropped a View object in the .xib file and also dragged and dropped a TableView object on top of it because I want to have some additional buttons in that class, but now its showing me this error: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ShowTaskViewController" nib but the view outlet was not set.'
Also this is the code I used to go to the ShowTaskViewController class before when it worked fine, now please help me to make the changes so the TableView object loads data properly.
-(IBAction)showAllTasks:(id)sender
{
ShowTaskViewController *showTaskViewController = [[ShowTaskViewController alloc] initWithNibName:@"ShowTaskViewController" bundle:nil];
[self presentModalViewController:showTaskViewController animated:YES];
}
This is because in you xib your haven't set your view outlet.
Open you xib file select File Owner
right click it and map your view outlet to your UIView in the xib.
For more detail plz check following links:
Loaded nib but the view outlet was not set - new to InterfaceBuilder
Error in Xcode "the view outlet was not set.'"
Hope this helps :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With