Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Draw This
($0.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-21-2009, 01:40 AM   #3 (permalink)
cation007
Registered Member
 
Join Date: Jul 2009
Posts: 20
cation007 is on a distinguished road
Default

Quote:
Originally Posted by FlyingDiver View Post
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 ?
cation007 is offline   Reply With Quote
 

» Advertisements
» Online Users: 611
10 members and 601 guests
Afrinux, Bryan1, drviii, Hamad, iamwayne5, jemicha, jon01, nguyenhieu129, Rynow, ThistleCoast
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 174,549
Threads: 93,727
Posts: 401,266
Top Poster: BrianSlick (7,954)
Welcome to our newest member, fgreg2692han
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:53 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.