我有一个 UITableViewController,我从故事板中取出并制作了一个自定义 UITableViewController 类来控制它。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. 此代码运行,但在此之后应用程序崩溃:
- (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];
}}
也许我在故事板中错误地连接了一些东西。