iOS Help: loaded the nib but the view outlet was not set
ios, ios4, ios5, iphone, objective-c
Solution
first declare outlet for your new tableView(Ctrl + Drag from xib to interface file) and later do something like this:
self.view=myTableView;
Problem
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]; } ```