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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:06:57+00:00 2026-06-09T04:06:57+00:00

I have three tableView one containg cateogry one containg type and other product name

  • 0

I have three tableView one containg cateogry one containg type and other product name i want that when user selct any category the type array should be loaded at run time getting the same type of the selected category

In my example if i select category Herbicide then it should insert the contents of the

typeHerbicides in arrayType but when i load table second it does not show any values

 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  return 1;
  }

// Customize the number of rows in the table view.

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


   if (tableView ==tblSimpleTable ) 


    return [categoryArray count];

   else if(tableView==tblSimpleTableType)

     return [typeArray count];

   else if(tableView==tblSimpleTableProduct)

    return [productArray count];

   else if(tableView==tblSimpleTableOneSection)

    return [categorySectionOneArray count];
   else if(tableView==tblSimpleTableTypeSection)

    return [typeArraySection count];
    else 

    return  [productArraySection count];
     }

// Customize the appearance of table view cells.

   - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {


    static NSString *CellIdentifier = @"Cell";

     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];


     if (cell == nil) {
     cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
     }


    if (tableView ==tblSimpleTable ) {


cell.textLabel.font=[UIFont fontWithName:@"Arial" size:16];

cell.textLabel.text = [categoryArray objectAtIndex:indexPath.row];
    return cell;


   }


    else if (tableView==tblSimpleTableType){

    cell.textLabel.font=[UIFont fontWithName:@"Arial" size:16];

    cell.textLabel.text = [typeArray objectAtIndex:indexPath.row];
    return cell;

   }



   else if(tableView==tblSimpleTableProduct) {

    cell.textLabel.font=[UIFont fontWithName:@"Arial" size:16];

    cell.textLabel.text = [productArray objectAtIndex:indexPath.row];
    return cell;



   }

   else if(tableView==tblSimpleTableOneSection){

    cell.textLabel.font=[UIFont fontWithName:@"Arial" size:16];

    cell.textLabel.text = [categorySectionOneArray objectAtIndex:indexPath.row];
    return cell;


    }

    else if(tableView==tblSimpleTableTypeSection){
    cell.textLabel.font=[UIFont fontWithName:@"Arial" size:16];

    cell.textLabel.text = [typeArraySection objectAtIndex:indexPath.row];
    return cell;

   }

   else {

    cell.textLabel.font=[UIFont fontWithName:@"Arial" size:16];

    cell.textLabel.text = [productArraySection objectAtIndex:indexPath.row];
    return cell;


   }
   }

     - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

     if (tableView ==tblSimpleTable ) {


    titleCategory=[categoryArray objectAtIndex:indexPath.row];

    NSLog(@"This is titleCategory Selected %@",titleCategory);



    NSString*test=@"Herbicides";




    if([titleCategory isEqualToString:test]){

     typeHerbicides=[[NSArray alloc] initWithObjects:@"ACCLAIM EXTRA",@"ILLOXAN",@"REVOLVER",nil];

    typeArray=[[NSArray alloc] initWithArray:typeHerbicides copyItems:YES];
    }

    else {
        typeArray=[[NSArray alloc] initWithObjects:@"ILLOXAN",@"REVOLVER",nil];

        typeArray=[[NSArray alloc] initWithArray:typeHerbicides copyItems:YES];

    }

    }

    else if(tableView==tblSimpleTableType) 

    titleType=[typeArray objectAtIndex:indexPath.row];

   else if(tableView==tblSimpleTableProduct)


    titleProduct=[productArray objectAtIndex:indexPath.row];

   else if(tableView==tblSimpleTableOneSection)


    titleSectionOneCategory=[categorySectionOneArray objectAtIndex:indexPath.row];


    else if(tableView==tblSimpleTableTypeSection)


    titleTypeSection=[typeArraySection objectAtIndex:indexPath.row];
    else 


    titleProductSection=[productArraySection objectAtIndex:indexPath.row];
    }
  • 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-09T04:06:58+00:00Added an answer on June 9, 2026 at 4:06 am

    When user selects any category then in didSelectRowAtIndexPath you can initialize your typeArray based on category selected:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if(tableView == tblSimpleTableType)
        {
           //initialize typeArray;
    
           //Once typeArray is initialized just reload the tableview as follows:
           [tblSimpleTableType reloadData];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have three divs in a container that I want to float over a large
In my tableview, I have one section, and in that section there are two
I have Three type of gestures in my view(tableview is my view) PinchGesture:redirecting to
I have three classes, I am simply display my Facebook friends in tableView. And
I have an app that has a TableView, NavigationView and TabBar running together. There
Have three classes User, Group and Field. Many to many relationship on User /
i have three lists with the same number of elements in each other, i
I have a tableView with multiple sections. When a sections contains only one row,
I have UITableView that contains many cell. User can expand cell to see more
I have a UITableView that I build in loadView . One of the things

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.