Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dstarsboy

macrumors newbie
Original poster
Sep 8, 2008
1
0
I have a UIViewController handling a few views. When my app starts I have it load the default UIViewController.view first. Actions cause additional subviews to be added to UIViewController.view but I want one of the subviews to be able to redisplay the UIViewController's default view and I can't make this happen.

I have code in the app delegate that handles showing all of the controller's views, here is what I've tried so far:

tried to just bring the view back to front but that didn't work:
window bringSubviewToFront:viewController.view];
[viewController.view setNeedsDisplay]

don't know why, but I tried to add it as a subview to itself (since this works for all other views)
[viewController.view addSubview:viewController.view];

tried reinitializing it like I did in applicationDidFinishLaunching
[window addSubview:viewController.view];
[window makeKeyAndVisible];

None of these work. Am I missing something really easy?

[EDIT] I just tried something that works.. leaving the default view completely blank and loading my former default view as just another subview, but I'm not sure if that's the way you should do it. If it is, what is the purpose of the default "view" in the UIViewController?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.