In my app, I am listing core data entries in a tableview. I want to allow the user to edit records using a detail view presented modally as a form view. I am observing peculiar behavior when editing records.
The flow:
- User loads tableview with records. -working
- User selects a record for editing. -working
- User edits record in a view controller presented as a modal form view. -working
- User saves edits and dismisses form view. -working
- Tableview shows correct changes for the previously edited record. -working
- User repeats steps 2 - 4 selecting a different record to edit. -working
- Tableview shows correct data for all records. -Not Working.
At step 7, the tableview reverts the display of the first edited record to its original state. Subsequent record edits result in all previous edits reverting to their original state. If the tableview is dismissed and reloaded, the records are correct, showing all the edits.
I have used [tableview reload] in the tableview's ViewWillAppear method, but it does not seem to be fired when the modal form view controller is dismissed.
In my tableviewcontroller code:
-(void)viewWillAppear:(BOOL)animated
{
[self.tableView reloadData];
}
Searching around, I have not found a solution and am hoping someone can point me in the right direction.
Thanks!