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

    Joined:
    Mar 13, 2008
    #1
    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:
    Code:
    @interface ListController : UITableViewController 
    	<UITableViewDelegate,UITableViewDataSource, UISearchBarDelegate> {
    
    @interface CustomerListViewController : ListController{
    And I left everything else as before. But when try to run it I get:

    Code:
    * 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

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #2
    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

    Joined:
    Mar 13, 2008
    #3
    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

    Joined:
    Jul 26, 2009
    Location:
    Stockholm, Sweden
    #4

Share This Page