P 254 Location to call the controller delegate


#1

I was having trouble getting the ItemsViewController to update immediately on dismissal of the modal view controller; it wouldupdate, but only after the DetailViewController had been activated again and dismissed again

it seems that the tableView doesn’t get updated properly (this might be something to do with the retains I have in the singletons to avoid the analyzer complaining?). So, after some analysis of what the flow I decided to put

if ([delegate respondsToSelector:@selector(itemDetailViewControllerWillDismiss:)]) {
[delegate itemDetailViewControllerWillDismiss:self];
}
in ItemDetailController viewDidDisappear, after the possession ivars had been updated. This is the same place they get updated when ItemDetailViewController exits back to ItemsViewController.
This seemed to work a bit better and I eliminated these lines in the save and cancel methods