ABNewPersonViewController imagePicker方向和崩溃问题

时间:2013-07-18 08:25:27

标签: ios ios6 abaddressbook

我的iPad应用仅支持横向显示。我已经以模态方式呈现了ABNewPersonViewController(在navigationcontroller中作为apple docs建议)并且处于土地景观中。

现在,

  1. 当我尝试“添加照片”时,imagePicker会根据我的要求在PORTRAIT中以模态方式呈现。
  2. 然后,在添加照片后立即点击图片会显示一个带有三个按钮的弹出窗口( - 选择照片,编辑照片,删除照片)。
  3.   

    点击前两个按钮会导致我的应用崩溃并出现以下错误   消息:

    *** 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;问候 海雀

2 个答案:

答案 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];解决了我的问题

相关问题