Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6973495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:06:56+00:00 2026-05-27T17:06:56+00:00

I need two UITableViews in the same NIB. I have used IB and created

  • 0

I need two UITableViews in the same NIB. I have used IB and created a view with the two tables.

My header file contains the ViewController and two classes, one for each of the tables (see below). In IB I can connect each table’s delegate and datasource to FileOwner, but I cannot work out how to create the IBOutlet connection. I’m getting this message: -[News tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x15d3c0
2011-12-11 07:20:27.480 myCity1[659:707] Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[News tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x15d3c0’

Here’s the header file:

@interface News : UIViewController {

}

@end

@interface TownNews : UITableViewController {

UITableView *townNewsTable;

}

@property (nonatomic, retain) IBOutlet UITableView *townNewsTable;

@end

@interface GeneralNews : UITableViewController {

UITableView *generalNewsTable;

}

@property (nonatomic, retain) IBOutlet UITableView *generalNewsTable;

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:06:56+00:00Added an answer on May 27, 2026 at 5:06 pm

    I was dealing with this thing in one of my projects (you can watch it: free app with name IJCAI11 in the appstore; the tab ‘People’ (there the indexing is done with a separate tableView)); and as far as I see by the code above, you’re making things to be too complicated. I’ll describe how I did it instead of saying what you shouldn’t do 🙂

    I had only one class, let’s say YaddaYaddaViewController.

    @interface YaddaYaddaViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
    {
        UITableView *tableView1;
        UITableView *tableView2;
    }
    @property (nonatomic, retain) IBOutlet UITableView * tableView1;
    @property (nonatomic, retain) IBOutlet UITableView * tableView2;
    
    @end
    

    Note that the viewController is derived from UIViewController, not UITableViewController (the goal of class UITableViewController is to be able to implement simple tableView in 2 minutes, for more custom stuff you should always use UIViewController. To read more about that, take a glance at the documentation of UITableViewController class).

    In the IB for “File’s Owner” I simply set YaddaYaddaViewController;
    I link the tableView1 and tableView2 outlets to the proper tables in the View;
    I link the delegate and the datasource to the both tableView1/2, so I have ‘multiple’ delegate and datasource.

    And finally, in the code, for all delegate methods (e.g. tableView:cellForRowAtIndexPath:)
    I just pay attention to the tableView value, a delegate-event of which caused the calling of this method, like:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if (tableView == self.tableView1) {
            // some code here
        } else {
            // alternative code here
        }
    }
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to have two UITableViews on one UIView. I can make it work
I have two View Controllers: TableViewController (which is used as a modal view controller)
I need two methods one to encrypt and one to decrypt an xml file
I need two tables and two sets of fields, not the name of the
Why do I need two of them? When I have to use one or
I have a form that has a group of 3 text_fields. I need two
I need UNION two tables with creating new field, where 1 for first table,
I need two conditional rules. Background: http://www.domain.com/.htaccess http://www.domain.com/index.php http://www.domain.com/admin/index.php I have both re-write rules:
I have several UITableViews, with different datasources in a iPad screen. I need to
Need help with the following. I am creating two different combinations of view/controllers that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.