问题现象

在洛书1.7.5版本中出现这样一个bug:从键盘跳转输入法主程序失败;导入文件时跳转主程序也失败; 调试应用时出现如下错误:

Objective-C exception thrown.  Name: NSInternalInconsistencyException Reason: Application has LSSupportsOpeningDocumentsInPlace key, but doesn't implement application:openURL:options: on delegate <AppDelegate: 0x283eda9c0>

原因分析

跳转时application:openURL:options:不存在导致出错;此前我重载了application:openURL:sourceApplication:annotation:方法就可以实现跳转功能,在Info.plist加了LSSupportsOpeningDocumentsInPlace的声明后,就出现了这个错误,但没有这键的话,上传app时又会出现如下的警告信息:

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:方法,调用和application:openURL:sourceApplication:annotation:一样的实现即可;