0

I have a splitview-based app, that has a popover menu containing 3 views. I would like to add another view, that doesn't appear in the popover menu, and is displayed when a different button is clicked.

enter image description here Here is a screenshot, with the popover menu, and the 'Log' button which I want to use to display my new view.

All of the other views are configured something like this:

 UIViewController <SubstitutableDetailViewController> *detailViewController = nil;

    if (row == 0) {
        FirstDetailViewController *newDetailViewController = [[FirstDetailViewController alloc] initWithNibName:@"FirstDetailView" bundle:nil];
        detailViewController = newDetailViewController;
    }

    ...

    NSArray *viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, detailViewController, nil];
    splitViewController.viewControllers = viewControllers;
    [viewControllers release];

I tried to replicate this code for my new view:

-(void)displayLogView{


    UIViewController <SubstitutableDetailViewController> *detailViewController = nil;

    LogDetailViewController *newDetailViewController = [[LogDetailViewController alloc] initWithNibName:@"LogDetailViewController" bundle:nil];
    detailViewController = newDetailViewController;

    // Update the split view controller's view controllers array.
    NSArray *viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, detailViewController, nil];
    splitViewController.viewControllers = viewControllers;
    [viewControllers release];

    [detailViewController release];
}

But nothing happens. I think that I am missing the code to actually display the view. I tried to find how the other views were displayed, but could not find anything (I got the code from the apple sample code).

Any help would be appreciated!

4

1 回答 1

0

如果您只想要一个幻灯片视图,请尝试使用presentModalViewController它来显示它并dismissModalViewController摆脱它。

于 2012-07-09T18:29:49.543 回答