我的iPad应用仅支持横向显示。我已经以模态方式呈现了ABNewPersonViewController(在navigationcontroller中作为apple docs建议)并且处于土地景观中。
现在,
点击前两个按钮会导致我的应用崩溃并出现以下错误 消息:
*** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <ABActionSheet: 0x9bbfde0; baseClass = UIActionSheet; frame = (0 0; 272 156); opaque = NO; animations = { opacity=<CABasicAnimation: 0xaa73d30>; }; layer = <CALayer: 0x9bd0370>> is associated with <_UIActionSheetHostingController: 0x9bb1000>. Clear this association before associating this view with <_UIActionSheetHostingController: 0xaa7a610>.'
任何一个和两个解决方案? 谢谢&amp;问候 海雀
答案 0 :(得分:1)
异常明确指出
"'A view can only be associated with at most one view controller at a time! "
您正在呈现 UIViewController ,并再次呈现 UIPopOverController 。单击按钮trieng的索引以显示控制器后,这是不可能的。'
根据您的资料尝试使用dismissViewController
方法。
答案 1 :(得分:0)
[navController setModalPresentationStyle:UIModalPresentationFormSheet];解决了我的问题