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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:01:22+00:00 2026-05-28T13:01:22+00:00

The user can select/deselect cells in each section, so to track all the selected

  • 0

The user can select/deselect cells in each section, so to track all the selected cells in the didSelectRowAtIndexPath is not useful:

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

    NSLog(@"row = %i, section = %i", indexPath.row, indexPath.section);
}

What i want instead is to save time and resources, so to let the user check/uncheck whatever he wants, and when he click on a button (to go to next view), i need to collect all selected cells in the whole table view. I tried to do like this:

-(IBAction)nextView:(id)sender{

themesChoosed=[self.tView indexPathsForSelectedRows];//tView is the outlet of my UITableView and themesChosed is an NSArray declared in the .h file
    for (int i=0; i<=[themesChoosed count]; i++) {
        NSIndexPath *thisPath = [themesChoosed objectAtIndex:i];
        NSLog(@"row = %i, section = %i", thisPath.row, thisPath.section);

}
}

But this doesn’t return me the selected cells, it shows me always: row = 0, section = 0 as if i am only selecting the first cell in the first section.
Any thoughts on how to do so?

  • 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-28T13:01:23+00:00Added an answer on May 28, 2026 at 1:01 pm

    Take in .h file

    NSMutableArray *selectedArray;
    

    in .m

    viewDidLoad
    
     selectedArray=[[NSMutableArray alloc]init ];
    
    in tableviewDidSelect
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    //According to section take value from table and get string selectedString.
    
    if([selectedArray containsObject:selectedString])
    
    {
    [selectedArray removeObject:selectedString];
    
    }
    
    else
    
    {
    [selectedArray addObject:selectedString];
    
    }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form where a user can select a rating from 1-5. Each
I have a form where a user can select a list of events, each
I am creating an application where the user can select multiple cells from a
There are several packages in my application that user can select each one according
My users can't seem to deselect all on a select in html. I have
Can a JApplet use a JFileChooser so that the user can select a file
I have a View where the user can select Basic Configuration and Advanced Configuration
I have a segmented control where the user can select how to order a
I am building a table using the DataGridView where a user can select items
We want to show a hint for a JList that the user can select

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.