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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:43:58+00:00 2026-06-16T11:43:58+00:00

I am trying to force selection(highlight) of a UITableViewCell using selectRowAtIndexPath.. For eg, Lets

  • 0

I am trying to force selection(highlight) of a UITableViewCell using selectRowAtIndexPath..

For eg,
Lets say i want to always have the first cell in a table view to be highlighted,I apply the following logic in viewDidAppear

[self.tableViewPrompts selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:0];

Works nicely.But when i try to apply the same logic elsewhere in the application the cell is not selected.I even tried deselecting other cells before calling the above method and reloading tableview before and after calling this method but none of the approaches seem to work!

I even used the tableview’s delegate to forcibly make a call to the didSelectRowAtIndexPath.Event this does not work.

PS: The selection of the cell does not trigger any action all i am trying to achieve is highlighting the desired cell.

What am i doing wrong here?

Help is greatly 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-16T11:43:59+00:00Added an answer on June 16, 2026 at 11:43 am

    The selection of the cell does not trigger any action all i am trying to achieve is highlighting the desired cell.

    Why don’t you use the cell’s highlighted property?

    UITableViewCell *cell = [self cellForRowAtIndexPath: [NSIndexPath indexPathForRow: 0 inSection: 0]];
    cell.highlighted = YES;
    

    Cant test it now, but it should work…..

    edit

    Better yet, of course: change your cellForRowAtIndexPath to do that

    -(UITableViewCell) tableView:cellForRowAtIndexPath:
    //...
    if (indexPath.row == 0 && indexPath.section == 0) cell.highlighted = YES
    else cell.highlighted = NO;
    //...
    return cell;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to force HTTPS on a domain. It must be done using
i'm trying to force a div to have a certain height depending on his
I have a stupid WinCE application where I'm just trying to force an exception
I'm trying to fasten posgresql selection using a function by means of saying it's
I am trying to get my hands on learning Visual force. I have an
I'm trying to force an inherited class to use a custom attribute. I'm creating
I am trying to force an iframe to the exact same height as the
I'm trying to force ssl on certain pages, but also on a directory. But
I'm trying to force all implementers of a protocol to implement a readonly property.
I'm having hard time trying to force https (ssl) to particular page on codeiginiter

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.