UITableViewController not redrawing new cell text label after popViewControllerAnimated
- by crunchyt
I have a problemetic UITableViewController fails to redraw an updated cell after a child view is removed.
Here's what's happening. After changing data in a child view, the parent view controller reloads the source data array and runs [tableView reloadData] via a PostNotification. After this triggers, I use popViewControllerAnimated to return to the parent UITableViewController (this pops the child view off the stack, and reveals the controller one level up).
However, my updated data does not appear in the parent view controller! According to the debugger, the cell's label has been updated, but the visible label does not change. However, if I scroll-flick the table, momentarily moving the updated cell out of view, when it reappears the label is updated!
I also try calling [tableView reloadData] via viewWillAppear but the issue still persists.
Here is some additional info that may be helpful. I have a 3 views structured like this:
1/ SettingsViewController : UITableViewController
2/ -- UserView : UITableViewController
3/ ---- UserDetailsView : UIViewController <UIActionSheetDelegate>
I am calling UserDetailsView from inside UserView as follows:
UserDetailsView *userDetailsView = [[UserDetailsView alloc] init];
[self.navigationController pushViewController:userDetailsView animated:YES];
If I return to the top-most controller (SettingsViewController) and then load the problematic controller (UserView), everything is drawn correctly. It is only when returning from a child view that this issue occurs.
Thank you in advance for your suggestions.