iOS12下跳转出现NSInternalInconsistencyException的解决方法
问题现象
在洛书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:一样的实现即可;
- 原文作者:岁寒
- 原文链接:http://www.suihanime.com/post/Xamarin/iOS12%E4%B8%8B%E8%B7%B3%E8%BD%AC%E5%87%BA%E7%8E%B0NSInternalInconsistencyException%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95/
- 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。