I’ve got a view controller, call it VC1, that’s a table view. When I tap a cell in the table view, I am presented with a new view controller, call it VC2, which is a short list of choices. After making a choice, I want to dismiss VC2 and set the cell.textLabel.text property of the VC1 cell I originally tapped to the value I selected in VC2.
Conceptually speaking, what is the proper way to do this? I’ve tried a handful of different approaches, but all of them seem wonky at best, and only one of them actually worked – although it was the most cumbersome of all, passing references to both view controllers and table view cells and all kinds of things. It just feels like I’m making a mountain out of what is probably a mole hill.
This is such a common paradigm that I find it hard to believe there’s not a simple method for doing it.
I do kind of that with with a table view presenting several attributes of an data object. To change a single attribute the user has to select the specific table cell showing the attribute he wants to change and that will push a new view controller (with a picker in my case) where the user can change the value from a selection.
I assign the data object to a property of the new controller before pushing. With this the value can be changed directly in the data object, and when i return (via navigation controller) to the first view controller there is a reloadData in viewWillAppear.
Did you try it this way?