Where to put global data and processing code?
Hi everyone,
I'm making a little app based on the "pickers" sample project from the "Beginning iPhone Development" book.
The book's example is basically how to use the UITabBarController and, in this case, the app has five unrelated views, one linked to each Tab and each view's data is processed and output to it's view through that view's controller.
So, the book's example structure looks like this:
AppDelegate
--View1Controller
--View2Controller
--View3Controller
--View4Controller
In my app, however, most of the views are related to one another and will thus share data. For example, one tab will give you a Search Screen and your selection from the search results will take you to another tab that will display data based on that result.
My questions are:
Where do I code-up the processing/data-population of the search result so it can be accessed by the other views? The only place I can think to put that code (so it will be global) is in the AppDelegate, but, is that bad form?
I can certainly figure out how to get the job done, I guess my question is more of a design problem or a best practices question...
Anyway, thank you for any advice.
Chris.
|