Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Select Cell after a Cell has been Deleted

lukeirvinlukeirvin Posts: 388 @ @
edited February 2014 in iOS SDK Development
I have a table where I want a specific cell to stay highlighted, even after other cells are deleted.

I have tried selectRowAtIndexPath:animated:scrollPosition after I reloadData but it is not working.
if (editingStyle == UITableViewCellEditingStyleDelete)
{
        // Delete the row from the data source
        if (indexPath.section == 0)
        {
            [self removeItem:indexPath.row]; //method for removing the item for what I am doing
            tableView.editing = NO;
            [tableView reloadData];
            [tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1] animated:NO scrollPosition:UITableViewScrollPositionNone];
        }
}

I can tap on the cells after I delete one, but I would like a cell to auto-highlight once a cell has been deleted.

Any thoughts?

Replies

Sign In or Register to comment.