views:

262

answers:

1

I have a UITableView on a view. This UITableView has cells which are made up of a checkbox custom control, a label and a disclosure accessory. When I select a row in the tableview it selects correctly (blue highlight shows 100% correctly).

I then created a didSelectRowAtIndexPath delegate to push a detail view controller onto the navigation stack using the following code:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    MyDetailsViewController *detailsViewController = [[MyDetailsViewController alloc] initWithNibName:@"MyDetailsView" bundle:nil];
    [[self navigationController] pushViewController:detailsViewController animated:YES];
    [detailsViewController release];
}

This works - in so far as that it pushes the view controller onto the navigation stack and presents the view. The problem I'm having is that the animation is really "flickery" and the row that was selected doesn't even get highlighted before the animation starts.

I've done this before (but never with custom cells) and I know that the procedure should be as follows: row highlights, detail view animates in, (edit details), detail view animates out, row gets deselected.

I'm not sure why my row automatically gets deselected (or de-highlighted) when I select it and why the animation is flickery.

Has anyone had this before?

+1  A: 

Ugh, I so hate it when I find the answer to my own question about a minute after posting it. The problem was that I was doing all kinds of things in viewWillDisappear that was modifying my table data. **grin**

rein