Can't sublcass a UITableViewController? Error:"didn't get a UITableView"

Discussion in 'iOS Programming' started by mamcx, Jan 27, 2009.

  1. mamcx macrumors regular

    Mar 13, 2008
    I have 4 UITableView that share a lot of common functionality.

    After build the first, I decide to put the common work in a superclass, then derive from it:
    @interface ListController : UITableViewController 
    	<UITableViewDelegate,UITableViewDataSource, UISearchBarDelegate> {
    @interface CustomerListViewController : ListController{
    And I left everything else as before. But when try to run it I get:

    * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "CustomerList" nib but didn't get a UITableView.
    This is not a suported scenario?
  2. caveman_uk Guest


    Feb 17, 2003
    Hitchin, Herts, UK
    The problem is that your nib doesn't have a tableview in it or at least it's not linked to the tableView outlet in the class.
  3. mamcx thread starter macrumors regular

    Mar 13, 2008
    Nope, I found my mistake: The superclass is a UITableViewController but the nib expext a UIViewController. I have search bar so can't be a direct descendant of UITableViewController.

    And tahnk you. I forget connect the table too ;)
  4. tomsoderlund macrumors newbie

    Jul 26, 2009
    Stockholm, Sweden

Share This Page