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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:46:37+00:00 2026-05-23T09:46:37+00:00

I have a UITableView with cells that push viewControllers onto the stack when selected.

  • 0

I have a UITableView with cells that push viewControllers onto the stack when selected. The child viewControllers take user input and then pops off the stack.

When the child viewController is popped, I want the parent tableView to update the value of the selected cell AND then deselect the row. I can update the cell using reloadData, and I can deselect the row using deselectRowAtIndexPath – but I can’t do both at the same time.

I understand why this is – reloadData deselects the cell implicitly, and deselectRowAtIndexPath deselects it explicitly, but I find it curious that I can’t find anyone wanting to achieve the same reload/deselect behavior. What am I missing here?

All code is in viewWillAppear:animated – I can get close if I put deselectRowAtIndexPath in viewWillAppear and reloadData in viewDidAppear, but this isn’t what I want.

  • 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-23T09:46:37+00:00Added an answer on May 23, 2026 at 9:46 am

    When you reload a cell, it automatically gets deselected. That’s because you don’t set a cell’s selected property to YES in tableView:cellForRowAtIndexPath:. So you will have to deal with this differently. Either identify that the cell at indexPath needs to be selected and appropriately set its selected property to YES in tableView:cellForRowAtIndexPath: or select it after you reload the data. In such case, you can execute the following methods –

    [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
                          withRowAnimation:UITableViewRowAnimationNone];
    
    [self.tableView selectRowAtIndexPath:indexPath 
                                animated:NO
                          scrollPosition:UITableViewScrollPositionNone];
    
    [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
    

    The order of steps are :-

    1. Reload the row without any animation.
    2. Select the row without animation.
    3. Deselect the row with animation.

    This way I think you can get the effect you want.

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

Sidebar

Related Questions

I have a UITableView whose cells contain custom ImageViews that asynchronously load the images
I have a UITableView with cells that contain a UISwitch control. It's similar to
I need some help. I have a UITableView that has cells that hold the
I have a ViewController that contains a UITableView in which the cells are created
I create UITableView and I have 3 cells , so each cell should push
I have a UITableViewController and when I push a particular view onto the stack
I have a UITableView cell that is going to have a variable size depending
I have a cell that I am inserting to the top of a UITableView.
I have a UITableView that displays single large images in each cell. The names
I have a uitableview that loads fairly large images in each cell and the

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.