I have an ios app that uses the master detail template, the master view passes the id of an NSString to a subview for the subview to display in a textview that the user can edit. What i want to do is, when the button is pressed to return from the subview to the master view, set the text of the NSString that was passed in to whatever the user changed it to. Is this possible?
Share
My answer to this is don’t pass a string to the detail view. Pass a model. There must be some overlying model to the data between the master and the detail. Pass the model, update the model in the detail, then when you go back to the master, the changes in the model will automatically be reflected in the master.
Here is an example assume that master contains a array of models which correspond to the cells of the tableView. Then, in the detail view, when you change self.model.myString the master view will be updated also.
…