views:

342

answers:

2

I have an app that is going to navigate to a UISplitView (inside another view altogether) like so:

- (void) switchToMyDayView {
    NSLog(@"Show My Day Screen");

    if (self.myDayController.view.superview == nil) {
        if (self.myDayController == nil) {
            MyDayController *myController = [[MyDayController alloc] initWithNibName:@"MyDay" bundle:nil];
            self.myDayController = myController;
            [myController release];
        }

        [homeScreenController.view removeFromSuperview];
        [self.view insertSubview:self.myDayController.view atIndex:0];
    }
}

Which is done on the main navigation screen

Now, the MyDayController has a XIB called MyDay.xib which has these items:

File's Owner: MyDayController

First Responder: UIResponder

Split View Controller

 ---->Navigation Controller

         ---->Navigation Bar

         ----> Table View Controller

                 ----> Navigation Item

 ---->View Controller

So, I need some more components here, I need a UITableViewController and a UISplitViewControllerDelegate correct?

I was going to just implement these protocols in my MyDayController, is this sort of standard?

So, after the code above, I get an error:

-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "MyDay" nib but the view outlet was not set.

so, how can I fix it using the UISplitViewController? I know that the UISplitViewController has a view property, but I cannot use it/connect it up in IB can I?

Thanks a lot

Mark

A: 

You should use split view as top-level view of your app's window(load at launch time), but not subview of others.

Tao
its not really a sub-view, its another section altogether
Mark
A: 

Hi,

I have given aan answer of similar question here.

Hope it helps.

Thanks, Madhup

Madhup