How to pass data to the parent view when using the UINavigationController and the default Back Button?

Background - so in terms of a high-level approach, it seems to me:

  • Save / save settings when you go through the UINavigationController level chain, so when you first start changing parameters or creating parameters, you will need a set of default values ​​- that is, at any time if the application dies the settings will be valid.
  • save the changes as they become available, and as soon as you return from the UINavigationController screens tree (with all settings set), you can save

This question focuses on Option 2, which I tried to implement.

Plan. While in the settings type of UINavigationController, I was going to transfer the existing (or default) data for one section of parameters from the parent view to the child view, when the child view gets on the stack. The problem is when this data is updated, and assuming that I want to stick to the back button by default, there seems to be no way to grab the back button by default, so when I am ready to pull the child out of the stack I will call before A delegate that transfers the last settings back to the parent.

QUESTION - How to transfer updated data from the child controller back to the parent controller when using the UINavigationController and want to stick to the "Back" button (with the left arrow on it).

, , , , ( ), .

+5
2

, SettingsController. ( , ). , ( - ), , .

- , , . , "", , , , .

+2

.

:

http://timneill.net/2010/11/modal-view-controller-example-part-2/

.

Edit:

  • , "", :

UINavigationController " " ?

:

[self.navigationController popViewControllerAnimated:YES]; 

. .

  1. : viewWillDisapper.

"". , , .

+3

All Articles