views:

1166

answers:

1
+1  A: 

(I have had the same problem, I wanted to add UIImageView's to my mainView and update them like that) I just used an NSMutable array of the ViewControllers you want to display in the view, then add or subtract from that as needed, and every time you add or subtract from that array, then call a metod from inside your mainView that goes through the scrollView and removes every view from the scrollView, and then adds the appropriate viewController to the scrollView. Hope this helps.

Jaba
That's actually what I'm trying to accomplish, but I can't seem to find how to reference the rootcontroller which holds the scrollview and all the code to load the views into the scrollview. I'm using a navigationviewcontroller and this code is in the appdelegate.Base code when creating a new Navigation app.- (void)applicationDidFinishLaunching:(UIApplication *)application { [window addSubview:[navigationController view]]; [window makeKeyAndVisible];}(not sure how to format code in the comment box)Is there a way to reference the rootviewcontroller through navigationController?
RoLYroLLs
Better yet, can't I just call the *parentcontroller*? (DUH)And then call that parent's controller method to refresh? I'll try that now...
RoLYroLLs
That was what I was trying to get across, I may have just not been clear enough.
Jaba
@Jaba - I got this done back when we spoke about it, but I now have another problem. I went ahead and coded it where I add the new viewController to an NSMutableArray, then remove everything from the scrollView and then add the views in the NSMutableArray again. The problem is that it takes a while for this to happen. About 2-3 seconds with about 4-5 views. Longer when it's all 13 views.
RoLYroLLs