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 4258220
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:37:12+00:00 2026-05-21T05:37:12+00:00

I have a tab view that loads a table view for each of the

  • 0

I have a tab view that loads a table view for each of the tabs

First tab interface declares UITableView *tableView;
Second tab interface declares UITableView *favTableView;

When declaring the number of rows for the second table this works:

- (NSInteger)tableView:(UITableView *)favTableView numberOfRowsInSection:(NSInteger)section {
    return [favList count];
}

But if I change it to:

- (NSInteger)favTableView:(UITableView *)favTableView numberOfRowsInSection:(NSInteger)section {
    return [favList count];
}

the app crashes when I try to load the second tab

Is my mistake (a) not understanding which is a variable/reserved word, (b) giving each table a unique identifier ie favTableView, instead of reusing tableView.

Also the second table doesn’t have a title bar

  • 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-21T05:37:13+00:00Added an answer on May 21, 2026 at 5:37 am

    The delegate method you must implement is

    -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    

    In this method prototype, tableView: (note the colon) is a fixed name you cannot change. The second instance of tableView is simply a local variable name that has meaning within the method. The following would also be valid:

    -(NSInteger)tableView:(UITableView *)tv numberOfRowsInSection:(NSInteger)section
    

    The delegate method names are what they are. You cannot decide that you want the delegate method names to be something else, or how would UITableView know what methods to call when it needed information from its delegate?

    So, for your table favTableView, if you specified the object that implements the above delegate method as favTableView’s delegate, then when called the local variable tv would in fact be the same as favTableView.

    I can see where you’d be confused about this. The SDK uses ‘tableView’ for a lot of things: method prototype placeholder names, variable names, and who knows what else. It boils down to being able to read and understand Objective-C method signatures. 🙂 It’s a little strange, until you get used to it.

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

Sidebar

Related Questions

I have a tab bar controller view that loads a record from an api
My problem is that I want to have a tab bar view with its
I have a tab contol with two tabs. Each one containing listviews. When the
I'm making a shopping cart. In one tab, I have a table view controller
I have an AJAX link that currently loads a partial view into a div.
I have an app that starts with a tableview (from a xib) that loads
I have a TabActivity that has three tabs. The fist tab is the problem.
I currently have an application that does the the following: S: Loads a view
I have a three view tab bar app the second view of which I
I have a UITableView that I am placing inside a TabView. I am trying

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.