1

I have an UITableViewController that Ive pulled out in story board and made a custom UITableViewController class to control it. The table is loaded correctly but when a cell is selected a segue is supposed to be preformed to a ViewController but instead the app crashes and I get this:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "lZs-yn-NHN-view-Nia-cR-yrl" nib but didn't get a UITableView.'
The UITableViewController is preceded by a tabViewController and a NavigationController in story board if that is affecting anything. This code runs but after this the app crashes:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"DisplayMovieFromAllMovies"]) {
    NSIndexPath * indexPath = [self.tableView indexPathForCell:sender];
    NSString * sectionHeader = [self.headerArray objectAtIndex:indexPath.section];
    NSDictionary * selectedMovieDict = [[self.movieSortedDict objectForKey:sectionHeader] objectAtIndex:indexPath.row];
    NSLog(@"selected: %@", [selectedMovieDict objectForKey:@"title"]);
    [segue.destinationViewController setMovieDict:selectedMovieDict];
}}

Maybe I wired something incorrectly up in storyboard.

Snick
  • 115
  • 1
  • 10
  • can you show some code?? for example the code into – mark jannet Nov 10 '13 at 02:29
  • Added code...but im wonder if I havent wired something up correctly... – Snick Nov 10 '13 at 02:38
  • I think, that this answer can help you http://stackoverflow.com/questions/11221802/nib-but-didnt-get-a-uitableview – alex_izh Nov 10 '13 at 05:39
  • Figured it out. The segue's destination controller was incorrectly made as a subclass of a UITableViewController but was supposed to be a subclass of a UIViewController. The nib meanwhile held a UIView controller for the destination controller. – Snick Nov 10 '13 at 07:51

0 Answers0