I'm currently working on the settings section of my iPhone app, and I just came to realization that if each page in the settings had it's own view and .h + .m, that would be A LOT of unnecessary code and views. So I came up with the conclusion that I would simply have only one type of detail view that would change depending on the row in a table view that the user selected. However... I'm kind of struggling.
The Setup:
- For the main settings view, I want it to be a grouped table view with multiple groups and rows.
- For the settings detail view, I also want it to be a grouped table view with multiple groups and rows (that is where it gets confusing).
I have seen simple things such as images and labels depend on the previous view, but not grouped table view structures. Is it possible to complete what I want without tons of views or 'if' statements? Any sort of help is apreciated.
You'll have to do two things (considering you have a setting view controller and a detail view controller)...
First, when a user selects a row in the setting view controller, you have to set the setting you'll be editing in the detail view controller. That is....
In your detail view, you'll have to modify the following method to render your table:
And you can't forget to reload the table:
This is assuming the following: