我正在尝试使用下面的教程在我的应用程序中导入和打开自定义文件
https://chariotsolutions.com/blog/post/importing-data-via-custom-file-types-in/
当我拖动扩展名为“.AMarkUp”的文件时,应用程序崩溃了
2019-03-11 11:28:37.661461 + 1100项目[15404:836338] *断言失败 - [UIApplication _applicationOpenURLAction:payload:origin:],/ BuildRoot / Library / Cache / com.apple.xbs / Source / UIKitCore_Sim / UIKit-3698.93.8 / UIApplication.m:6851 2019-03-11 11:28:37.682291 + 1100 Project [15404:836338] *由于未捕获的异常'NSInternalInconsistencyException'而终止app,原因:'Application有LSSupportsOpeningDocumentsInPlace键,但不是实现应用程序:openURL:options:on delegate'
如何解决此问题并不“实现应用程序:openURL:options:on delegate”?
谢谢您的帮助
您需要在AppDelegate.swift文件中实现指定的UIApplicationDelegate
方法。
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool {
// handle the file here
return true // or false based on whether you were successful or not
}