Adding a root view before ListViewController


#1

I’m playing around with the code from this section and pulling in an xml feed from another site. I’ve changed all the variables and I can get a populated list and choose a row and get a picture of what’s in the list.

What I’d like to do is go create a root view that is seen before what I’m seeing now.

So I have a ListItemView that lists out “items”. When I choose an “item” from the row I get a picture of the item.

What I want to do is have a MenuController so I can choose one of the following:

Top 100
Games (this is what I’m using now for "items"
Played

I’ve created a MenuViewController and put the above options into an array and I can get those to display first. But when I click on Games (the code that we were using for ListViewController) I get an error. I’m not sure if the error is really important right now because I’m not sure if I’m going about this the right way.

My new NerdAppDelegate:

[code]- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.

//ListViewController *lvc = [[ListViewController alloc]initWithStyle:UITableViewStylePlain];

//sets MenuViewController as the rootcontroller
MenuViewController *menuController = [[MenuViewController alloc]initWithStyle:UITableViewStylePlain];

UINavigationController *masterNav = [[UINavigationController alloc]initWithRootViewController:menuController];

//UINavigationController *masterNav = [[UINavigationController alloc]initWithRootViewController:lvc];

WebViewController *wvc = [[WebViewController alloc]init];

//for ListViewController
[lvc setWebViewController:wvc];

//for MenuViewController

//since the ListViewController is what will be using the setWebView it seems this should stay the same. or should this go in didFinishLaunchingWithOptions in another class?
// [menuController setWebViewController:wvc];

[[self window] setRootViewController:masterNav];

//Should I be adding addSubview right here??

self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;

}[/code]

Do I need to use addSubview?

Thanks…