2014-11-05 44 views
1

我遇到了https://issues.apache.org/jira/browse/CB-7679中描述的問題。當使用輸入類型文件時,InAppBrowser在iOS 8.1上崩潰

我打開具有<input type="file" accept="image/*">的InAppBrowser窗口PhoneGap的應用程序。當我單擊「拍攝照片」或「選擇現有的」窗口關閉,我得到了以下錯誤消息:

Warning: Attempt to present 
<UIImagePickerController: 0x137001c00> on <CDVInAppBrowserNavigationController: 0x136d2ed20> 
whose view is not in the window hierarchy! 

相同的代碼適用於iOS 7,我使用的版本是爲如下:

  • 的iOS:8.1
  • 的PhoneGap:3.6.0
  • InAppBrowser:0.5.3

有什麼W¯¯ ith他們處理視圖/控制器的方式/ https://github.com/apache/cordova-plugin-inappbrowser/blob/master/src/ios/CDVInAppBrowser.m看看插件代碼,有沒有可以嘗試的解決方法?

我真的不知道我的Objective-C的方式,但我嘗試了一些解決方案,建議在類似的非PhoneGap相關的iOS問題沒有任何運氣。

回答

1

一些試驗和錯誤和讀取類似的問題後,我終於找到了我的解決方案在https://stackoverflow.com/a/26238123/467650

訣竅是覆蓋CDVInAppBrowserNavigationControllerdismissViewControllerAnimated:Apache的科爾多瓦的問題跟蹤

-(void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion 
{ 
    if (self.presentedViewController) 
    { 
     [super dismissViewControllerAnimated:flag completion:completion]; 
    } 
} 

問題:https://issues.apache.org/jira/browse/CB-7679

0

此修復工作在我的iPhone與iOS 8.1(12B411),但不是我的iPad上的iOS 8.1迷你視網膜(12B410) 而iPad從一開始就表現出不同的行爲雖然與整個應用程序崩潰,而不僅僅是InAppBrowser窗口關閉意外

+0

現你使用Xcode 6來構建應用程序?你是否能夠從發生崩潰時獲取日誌? – 2014-11-11 03:59:53