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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:55:54+00:00 2026-06-15T10:55:54+00:00

I have a fairly commonplace grouped UITableView that allows a user to select a

  • 0

I have a fairly commonplace grouped UITableView that allows a user to select a department. When they select a row, I update the accessory view to display a checkmark on the new row and remove it from the previous row.

I also allow editing of the table view. In edit mode, the checkmarks are hidden, which is fine. But if the user deletes the row for the currently selected (checked) department, I need to programmatically move the checkmark.

I have tried using the same approach that I use to add and remove the checkmarks when a new department is used:

- (void)deleteDepartmentAtIndex:(NSInteger)index
{
    //if the current item is using the deleted department, move the checkmark
    Department *dept = [self.departments objectAtIndex:index];
    if (self.item.department == dept)
    {
        UITableViewCell *noneCell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:self.departments.count inSection:0]];
        noneCell.accessoryType = UITableViewCellAccessoryCheckmark;
        [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForItem:self.departments.count inSection:0]] withRowAnimation:UITableViewRowAnimationAutomatic];
    }

    //delete the department and save
    [dept.managedObjectContext deleteObject:dept];

    //delete the row
    [self.tableView deleteRowsAtIndexPaths:@[[NSIndexPath indexPathForItem:index inSection:0]] withRowAnimation:UITableViewRowAnimationFade];
}

But when the table view exists edit mode, no row has the checkmark accessory. I have even tried manually reloading the row whilst still in edit mode (as seen in the code above).

How can I make sure that the row’s accessory is refreshed when the table view exits edit mode?

  • 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-15T10:55:55+00:00Added an answer on June 15, 2026 at 10:55 am

    You should use accessoryType for non-edit mode and use editingAccessoryType for edit mode. This way you don’t have to clear the checkmark or restore the checkmark going in and out of editing mode. Set the editingAccessoryType to UITableViewCellAccessoryNone.

    And of course you need to make sure that your cellForRowAtIndexPath: always sets the proper accessoryType for each row.

    Edit:

    Overriding setEditing:animated: will allow you to reload the checked row (if visible) when leaving edit mode.

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

Sidebar

Related Questions

I have a fairly complex user drawn control that is double buffered. Works very
I have a fairly simple Rails application that allows users to manage their clients
I have a fairly simple query: SELECT invoice_id WHERE employee_id = 'XXXX' AND customer_id
I have a fairly standard OLTP normalised database and I have realised that I
I have a fairly simple problem. I'm trying to make a function that accepts
I have a fairly large Indesign file with a text field that needs to
I have fairly large C++ library with several sub-libraries that support it, and I
I have a fairly simple problem. I have a select dropdown with values 1
I have some fairly complex requirements for a SOLR search that I need to
I have a fairly standard star voting functionality in my app that uses jQuery's

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.