I have 2 ViewControllers, in 1st – TableView and in 2nd – button with label on it. When I click on the button in 2nd ViewController I need to go back on TableView and set in
cell.detailTextLabel.text
text from label on the button.
For go back to first view I use:
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:1] animated:YES];
but how I can set label from second view to:
cell.detailTextLabel.text
in first view?????
I would define a protocol & delegate in the second view controller
then when the button is tapped call the delegate:
In your first view controller implement the protocol
when you push the second view controller, set the first as the second delegate:
And implement the delegate method to get notified when the button tapped