I was wondering if someone could provide some guidance on the preferred way to handle a common scenario related to the example in this chapter. When you have a table view and you allow the user to click on a cell to get to a more detailed view, what if you wanted to allow the user to make and save changes while they remain on that details view. In this chapter the authors show how to pass an item for viewing only, but not for updating. To allow updating in the details view, where would you call the ItemStore? Do you have to pass it in to the DetailsViewController similar to how you passed in the item in this chapter? So should the prepare for segue have a second line for the ItemStore, like this?:
detailViewController.item = item
detailViewController.itemStore = itemStore
Or is there a different way of handling this scenario?
One behavior I would like to include is to allow the user to abandon changes. So if they hit the navigation button to get back to the table view and they haven’t yet saved, they will be prompt. If they say no, then changes will not be persisted.