I’m having a problem pushing a UITableViewController onto a NavigationController. With the following code:
ProblemEditController *problemEditController = [[[ProblemEditController alloc] initWithNibName:@'ProblemEditController' bundle:nil] retain]; problemEditController.problem = [[Problem alloc] init]; [self.navigationController pushViewController:problemEditController animated:YES]; [problemEditController release];
The navigation controller works as expected, however, the table view is not showing. numberOfSectionsInTableView is being called on my UITableViewController, but numberOfRowsInSection and cellForRowAtIndexPath aren’t being called, and the view shows up blank.
Is there something obvious I am missing?
EDIT
I’ve changed something in the nib file (stupidly, can’t remember what), and I’m seeing numberOfRowsInSection being called now.
OK, I’ve found out what I was doing wrong. I had added a TableViewController to my nib rather than just added a table view.
I’d basically messed up the connection to view in IB. For future reference, this is what a custom UITableViewController should look like in IB:
alt text http://pix.im/files/134/scaled.jpg?1239453713
Now I feel like a cretin.