Background – So in terms of approach at the high level there to me seems to be:
- Save/persist settings as you proceed through a chain of UINavigationController levels – so when initially starting to change settings, or create settings, there would need to a default set of values – i.e. so at any point of time if the application dies the settings would be valid
- save up changes as you go, and once you come back out of the UINavigationController tree of screens (with all settings set) there would be a point where you can save
This question is focusing on Option 2 which I was trying to implement.
The Plan – Whilst in a settings type UINavigationController I was going to pass existing (or default) details for one section of the settings from the parent view to the child view when the child view gets pushed onto the stack. The issue is when this data is updated, AND assuming I want to stick with the default Back Button, there does not seem to be a way to intercept the default Back Button, so that when I'm ready to pop the child off the stack just before this I will call a delegate which will pass the latest settings back to the parent.
QUESTION – How to pass updated data from a child controller back to the parent controller when using a UINavigationController and wanting to stick with the default Back Button (with the left arrow thing on it).
That is, probably I have isn't how to pass the data back I guess (I'm going to use a delegate), but rather how to hook into a callback method at the right point of time in the child controller so as to then use the delegate method to pass the data back.