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

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

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 05-09-2009, 09:56 AM   #9 (permalink)
FlyingDiver
Former NeXTStep Developer
 
Join Date: Mar 2009
Posts: 997
FlyingDiver will become famous soon enough
Default

You don't need to store pointers to the delegate in the view controllers, you can just do something like:

Code:
	SatPointerAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
	[delegate.rootViewController update];
This way, if you have an "update" method in that view controller, you can force an update anytime. And you might want that view controller to have a list of all it's sub controllers, and force each of them to do an update from that same method. Just iterate through the list, sending an update (or even just "reload") method to each.

You really don't want to be maintaining lots of view controller pointers in the different controllers, because it makes a real mess if you add or delete one.

It also sounds like you're using a database or some other external storage for your data, and accessing it from each view controller to get what that controller needs. I would suggest that you encapsulate all that in a custom class (model class for that data). Then if you need to change the storage mechanism for that data, only the one class needs to know. You might decide to do that to migrate to CoreData in 3.0, for instance.

joe

joe
FlyingDiver is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,637
Threads: 94,101
Posts: 402,822
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jessicagx69
Powered by vBadvanced CMPS v3.1.0

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