10

我的应用在 iOS 5.1 之前运行良好。它在左侧窗格中UISplitviewController带有 a ,并根据在其中所做的选择更新详细信息窗格。UINavigationControllerUINavigationController

iOS 5.1 特有的从左侧滑入替换弹出框的新功能;它看起来不太好,但它有效。

似乎被破坏的是纵向条形按钮中“弹出框”的显示。它会导致异常 -'NSInternalInconsistencyException', reason: 'Unknown direction passed to _popoverViewSizeForContentSize:arrowDirection:'

我试图覆盖显示弹出框的方法,如下所示:

-(void)splitViewController:(UISplitViewController *)svc popoverController:(UIPopoverController *)pc willPresentViewController:(UIViewController *)aViewController { [self.popoverController presentPopoverFromBarButtonItem:self.masterPopoverButtonItem permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }

但我仍然得到同样的错误。任何人都可以帮忙吗?

4

1 回答 1

0

使用以下代表从详细信息页面显示母版页

- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:

    (UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
    {
        barButtonItem.title = NSLocalizedString(@"Master", @"Master");
        [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
        self.masterPopoverController = popoverController;
    }

    - (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
    {
        // Called when the view is shown again in the split view, invalidating the button and popover controller.
        [self.navigationItem setLeftBarButtonItem:nil animated:YES];
        self.masterPopoverController = nil;
    }
于 2013-06-12T06:50:36.847 回答