問題現(xiàn)象
在洛書1.7.5版本中出現(xiàn)這樣一個bug:從鍵盤跳轉(zhuǎn)輸入法主程序失斆浴掏婶;導入文件時跳轉(zhuǎn)主程序也失斕硭摺摧莽;
調(diào)試應(yīng)用時出現(xiàn)如下錯誤:
Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Application has LSSupportsOpeningDocumentsInPlace key, but doesn't implement application:openURL:options: on delegate <AppDelegate: 0x283eda9c0>
原因分析
跳轉(zhuǎn)時application:openURL:options:不存在導致出錯挑社;此前我重載了application:openURL:sourceApplication:annotation:方法就可以實現(xiàn)跳轉(zhuǎn)功能陨界,在Info.plist加了LSSupportsOpeningDocumentsInPlace的聲明后,就出現(xiàn)了這個錯誤痛阻,但沒有這鍵的話菌瘪,上傳app時又會出現(xiàn)如下的警告信息:
Invalid Document Configuration - Document Based Apps should support either the Document Browser (UISupportsDocumentBrowser = YES) or implement Open In Place (LSSupportsOpeningDocumentsInPlace = YES/NO).
解決方案
在AppDelegate類中重載application:openURL:options:方法,調(diào)用和application:openURL:sourceApplication:annotation:一樣的實現(xiàn)即可录平;