I am developing my first iPhone application, and when implementing custom settings, I have a few questions about how best to implement this.
Assume that the base MVC: MainView template displays data stored in a model object; MainViewController handles the application logic.
For options, I have OptionView and OptionViewController. The RootViewController handles swapping of the Main and Options views.
First of all, what about these options? Would I like to create a class based on NSOjbect to store them (OptionModel)? Or maybe a simple NSDictionary will suffice?
Secondly, who owns these options? They are application prefixes, but their storage in AppDelegate seems incorrect. MainViewController basically takes care of the parameters, and the OptionsViewController needs to edit them, but these guys don't know about each other and probably shouldn't. The RootViewController is aware of everyone, so itโs in a good position to pass options between them, but again, this seems wrong.
Finally, the MainViewController will often need access to parameters. Does he have to call the options model each time to get an option, or cache his own copy? I donโt like the idea of โโadditional data to get additional data, but having copies in MainViewController that might go out of sync is also not very attractive.