5.1中的popover初始化错误



我得到的应用程序正在使用SplitViewController和popover,标准的东西。从sdk 3.0开始,它在10个版本中运行良好。它仍然可以在Snow Leopard、Xcode 4.2和sdk 5.0的模拟器中编译并运行良好。然而,当在Lion、Xcode 4.3和sdk 5.1上运行时,它会抛出错误:

断言失败-[UISlidingPopoverLayoutInfo_popoverViewSizeForContentSize:arrowDirection:],/SourceCache/UICit_Sim/UICit-1914.84/_UIPopoverLayoutInfo.m:160

*由于未捕获的异常"NSInternalConferenceException"而终止应用程序,原因:"未知方向传递给_popoverViewSizeForContentSize:arrowDirection:"

popover仅作为类的一部分启动:

@interface NewsDetailViewController : UIViewController <UIActionSheetDelegate, UISplitViewControllerDelegate, UIWebViewDelegate>{
    RssFunAppDelegate * _appDelegate;
    UITextView * _titleTextView;
    UINavigationBar * _navigationBar;
    UIPopoverController * _popContr;    
    UIWebView * _webView;
    UIActivityIndicatorView * _activityIndicator;
}

您需要发布初始化UIPopoverController的代码才能获得真正的帮助。

不过,从阅读异常文本开始,我将首先研究初始值设定项,看看是否将其设置为任何奇怪的内容。唯一支持的值是:

UIPopoverArrowDirectionUp
UIPopoverArrowDirectionDown
UIPopoverArrowDirectionLeft
UIPopoverArrowDirectionRight
UIPopoverArrowDirectionAny

或这些的按位组合,例如

UIPopoverArrowDirectionLeft | UIPopoverArrowDirectionRight