2013-07-18 40 views
0

我的iPad應用程序僅支持橫向。我以模態方式呈現了ABNewPersonViewController(在navigationcontroller中爲apple文檔建議),並且處於景觀風景中。ABNewPersonViewController imagePicker方向和崩潰問題

現在,

當我試圖「添加照片」
  1. 的imagePicker有模式在對我的要求提出的肖像。
  2. 然後,在添加照片之後,點擊圖片會顯示一個包含三個按鈕( - 選擇照片,編輯照片,刪除照片)的彈出窗口。

點擊前兩個按鈕崩潰我的應用程序下面的錯誤 消息:

*** 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>.' 

一和二的任何解決方案? 感謝&問候 AUK

+0

顯示一些代碼..? –

+0

ABNewPersonViewController * newpersonVC = [[ABNewPersonViewController alloc] init]; newpersonVC.newPersonViewDelegate = self; UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:newpersonVC]; [self presentViewController:nav animated:YES completion:Nil];據瞭解, – AUK4SO

回答

1

例外明確指出

"'A view can only be associated with at most one view controller at a time! "

您正在呈現的UIViewController再次與該呈現UIPopOverController。點擊按鈕的索引以呈現控制器後,這是不可能的。'

根據你的東西試用dismissViewController方法。

+0

。但我們沒有訪問popover – AUK4SO

0

[navController setModalPresentationStyle:UIModalPresentationFormSheet];修復了我的問題