I’m having trouble controlling some variables on my view controller with my navigational controller. So when I press the back button I want to run a method(function) on that view controller before it goes to the previous view controller.
I’m having trouble controlling some variables on my view controller with my navigational controller.
Share
You can either define a custom action for the back button, run your code, and then call
[UINavigationController popViewController:animated:], or you can set your code in-viewWillDisappear:if that’s appropriate for what you’re doing.