I have 8 detail view controllers and 1 main controller in a storyboard setup.
The main controller features a table with 8 rows which link (push) to each relevant module controller.
If I make a change on a module controller page then use the navigation (back) to return to the main controller and then try to go back into that page via the table links, the data resets.
How can I setup the storyboard so that data saves in-between navigation?
its hard to tell exactly what you are trying to do, but you mentioned that the data "resets".
If order to not get data to "reset", you need to read that data in from userDefaults rather than reading it in from the initial view controller data.
For example if you go to a view controller and it defaults to a "red house" and then the user can change it to a "blue house" withint the controller, you need to save that blue data and when you reload the view, find out what color it is supposed to be by reading in the data from userDefaults, rather than defaulting to "red"
its hard to tell exactly what you are trying to do, but you mentioned that the data "resets".
If order to not get data to "reset", you need to read that data in from userDefaults rather than reading it in from the initial view controller data.
Bollocks.
You could use user defaults to save the state, but you don't have to do it that way.
In fact, using user defaults is an ill-fitting approach to the problem of saving state in memory. User defaults writes files to disk, which is much slower, and causes the state save to persist even if you exit the app. (yes, it's much slower even in iOS, where the "disk" is really flash memory.)
If you want the state to persist after exiting and re-launching then saving it to user defaults is a reasonable approach.
If you're only saving state information for the case where a user switches from one view to another and back, it would be much better to use a data container singleton to save the state data there. (See the link to the password generator in my signature for an example of a data container singleton.)
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Ideally what I am trying to build is a multipage form.
1st Page - List of 8 Rooms - linking to 8 individual view controllers
each 8 view controllers contains text fields that need to be saved. For example if the user selects from the 1st page 'Bedroom', fills in some text fields, then returns to the home page, selects 'Bathroom', fills in some text fields, the text fields in 'Bedroom' should remain either until a) the user clicks a button to email the information for all 8 rooms or b) closes the app.
Just a thought...but could it be todo with the use of the segue?
I know if I pushed navigation from 1 to 2 to 3 to 4 and so on, the data would be save if I clicked back from 4 to 3.
However sometimes I may want to go from 4 back to 1 (main screen) then back to 4 again and the data will reset (text box's to zero)
?
It has to do with the way Storyboard works. I'm still trying to figure this out. It seems that storyboard always releases a view controller when you leave it, and always creates and initializes a new copy of the view controller you are switching to.
I want to understand how you set up your program so storyboard switches between persistent instances of your view controllers. It does not seem like it 's set up to do that.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.