Right now I'm working on an iPhone app. There are several view controllers that are working with data that needs (for the most part) to be shared through all the controllers. Right now I have a DataController model class for this.
My AppDelegate class has an instance of the DataController class called myDataController. Each view controller also has an instance of a DataController. Whenever I init a new view controller, I set the new view controller's DataController equal to my old DataController (originally from the AppDelegate). So if View Controller A changes something, View Controller B (pointing to the same DataController) sees the change as well.
I'm just wondering if this is a good way to go about doing things. Would delegation be a better idea? Should I make my AppDelegate also function as a "Data Delegate" that can return the data that I need to each view controller?
Which approach is more efficient? Are both about the same? Is one more preferred?
My AppDelegate class has an instance of the DataController class called myDataController. Each view controller also has an instance of a DataController. Whenever I init a new view controller, I set the new view controller's DataController equal to my old DataController (originally from the AppDelegate). So if View Controller A changes something, View Controller B (pointing to the same DataController) sees the change as well.
I'm just wondering if this is a good way to go about doing things. Would delegation be a better idea? Should I make my AppDelegate also function as a "Data Delegate" that can return the data that I need to each view controller?
Which approach is more efficient? Are both about the same? Is one more preferred?