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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:57:25+00:00 2026-06-14T15:57:25+00:00

When i select a row of UITableView it becomes green(customized), but when i select

  • 0

When i select a row of UITableView it becomes green(customized), but when i select another row, previously selected row do not stay green. I’m reloading my table after every row selection.I’ve tried this

NSIndexPath *selection = [mainTable indexPathForSelectedRow];
[mainTable selectRowAtIndexPath:selection animated:NO
scrollPosition:UITableViewScrollPositionNone]; 

but with this code i get only most recent selected row green(selected)
I’ve searched for this and found some suggestions, most of them suggest to store index value of selected row in an array and use this array later, i’ve tried this but it did not work.
Any other suggestion or sample code will be appreciated.

  • 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-14T15:57:27+00:00Added an answer on June 14, 2026 at 3:57 pm

    Do this:

    mainTable.allowsMultipleSelection = YES;
    

    From the UITableView Class Reference:

    allowsMultipleSelection

    A Boolean value that determines whether users can select more than one row outside of editing mode.

    @property(nonatomic) BOOL allowsMultipleSelection

    Discussion

    This property controls whether multiple rows can be selected simultaneously outside of editing mode. When the value of this property is ‘YES’, a check mark is placed next to each row that is tapped. Tapping the row again removes the check mark. If you call indexPathsForSelectedRows, you can get the index paths that identify the selected rows.

    The default value of this property is NO.

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

Sidebar

Related Questions

I have to select a row in my UITableView after the view did load.
I have a UITableView , which when I select a row, I want to
If I were to select a row from a table I basically have two
I'm trying to determine the indexPath of the select row of my UITableView so
When I select a row on my UITableView , the call to the handler
I have a UITableView for different datas. When the user select one row, then
I want to change the color of selected row and unselected row in uitableview
I have a selection that will select just 1 row of category. but I
How do I programmatically select a UITableView row so that - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
I have a grouped UITableView in class A and if you select a row

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.