UISplitViewController iOS 5.1导致弹出箭头方向错误

时间:2012-04-11 10:15:20

标签: ios uisplitviewcontroller uipopovercontroller

我的应用程序在iOS 5.1之前完美运行。左侧窗格中的UISplitviewControllerUINavigationController,并根据UINavigationController内的选项更新详细信息窗格。

从左侧替换弹出的新滑入,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]; }

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

1 个答案:

答案 0 :(得分: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;
    }