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

  • SEARCH
  • Home
  • 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 7861527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:46:14+00:00 2026-06-02T22:46:14+00:00

Hello I am brand new to xCode and iPhone development. I have two different

  • 0

Hello I am brand new to xCode and iPhone development. I have two different TableView controls on one page. I have NSArray #1 that needs to be the datasource of TableView #1 and NSArray #2 that needs to be the datasource for TableView #2.

The only trouble is that NSArray#1 populates both TableView1 and TableView2. I looked through the code and can’t seem to find where you can distinguish which NSArray belongs to each TableView.

Any help will be appreciated. Thanks in advance!

@interface GrainBinContentsEstimatorViewController : UIViewController
<UITableViewDelegate, UITableViewDataSource>
{
    UITableView *tableViewGrainBinType;
    UITableView *tableViewGrainType;
}

@property (strong, nonatomic) NSArray *arrayGrainBinTypes;
@property (strong, nonatomic) NSArray *arrayGrainTypes;
@property (nonatomic, retain) UITableView *tableViewGrainBinType;
@property (nonatomic, retain) UITableView *tableViewGrainType;

@implementation GrainBinContentsEstimatorViewController
@synthesize arrayGrainBinTypes, arrayGrainTypes, tableViewGrainBinType, tableViewGrainType;

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.arrayGrainBinTypes = [[NSArray alloc]
                       initWithObjects:@"RF", @"RC45", @"RC60", nil];

    self.arrayGrainTypes = [[NSArray alloc]
                            initWithObjects:@"Wheat", @"Corn", @"Soybeans", @"Rice", @"Milo", @"Barley", nil]; 
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
    return @"Select Bin Type";
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [self.arrayGrainBinTypes count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {
        cell = [[UITableViewCell alloc]
                initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    cell.textLabel.text = [self.arrayGrainBinTypes objectAtIndex: [indexPath row]];
    return cell;
}
  • 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-06-02T22:46:15+00:00Added an answer on June 2, 2026 at 10:46 pm

    In every delegate method (callback) the caller (tableview) is passed as a parameter. So you can switch based on this parameter like:

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
       if (tableView == self.tableViewGrainBinType) return [self.arrayGrainBinTypes count];
       else return [self.arrayGrainTypes count];
    }
    

    You get the idea…

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

Sidebar

Related Questions

Hello dearest community. I have trouble in the last two days, that I can't
Hello does any one know that setting I need to ON for connect to
Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
I have a brand-new off-the-cd OSX 10.6 installation. I'd now like to compile the
hello i got a problem with comparing two char* variables that contains numbers for
Hello I have an example that works properly: $(function() { $(#treegrid).jqGrid({ url: 'tree2.json', datatype:
Hello There, I am new to phonegap.I am trying to record a audio clip
Hello I want to know how to highlight all Words that is inputted in
Hello everyone i am developing an quiz based app in android and i have
Hello there I am new to php and want to learn to write reusable

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.