Quote:
Originally Posted by FlyingDiver
Your question is clear enough.
The usual method is to have a class just to manage the database. You create an instance of the class in your AppDelegate, and initialize it from the database. Then, any view or controller or whatever that needs access to the data gets the pointer to the Data class from the AppDelegate, and messages that Data class to get the info needed.
That way the internals of the data storage are encapsulated in that one data management class.
joe
|
Hi,
Thanks for replying.
I got what you meant. But I still din't understand how it works.
Say for Eg:
I have a model called dataModel. and I create an object and initialize within the appDelegate.
appDelegate.m:
dataModel *dataObject = [[dataModel alloc] init];
Now, how will rootViewController access that object ?
(or)
what should be the code within rootViewController.m to access it ?
am I missing any basics about delegates ?