相关疑难解决方法(0)

iOS13模拟器上的UIDocumentBrowserViewController错误“无法为URL创建urlWrapper”

UIDocumentBrowserViewController在iOS 13上进行测试时,我遇到了一个非常奇怪的问题。importHandler(newDocumentURL, .move)似乎无缘无故地崩溃了:

[DocumentManager] Cannot create urlWrapper for url file:///.../tmp/23720D22-BC1D-4E7B-A7AE-A1C8B0293F9E.txt. 
error Error Domain=NSPOSIXErrorDomain Code=22 "couldn't issue sandbox extension com.apple.app-sandbox.read-write for '/.../tmp/23720D22-BC1D-4E7B-A7AE-A1C8B0293F9E.txt': 
Invalid argument" UserInfo={NSDescription=couldn't issue sandbox extension com.apple.app-sandbox.read-write for '/.../tmp/23720D22-BC1D-4E7B-A7AE-A1C8B0293F9E.txt': Invalid argument}.
Run Code Online (Sandbox Code Playgroud)

这是一个复制的两步过程:

  • 创建一个新的Xcode项目“基于文档的应用程序”
  • documentBrowser(_: , didRequestDocumentCreationWithHandler:)

    let newDocumentURL: URL? =
        URL(fileURLWithPath: NSTemporaryDirectory())
            .appendingPathComponent(UUID().uuidString)
            .appendingPathExtension("txt")
    
    // Set the URL for the new document here. Optionally, you can present a template chooser before calling the importHandler.
    // Make sure the importHandler is always called, even if the …
    Run Code Online (Sandbox Code Playgroud)

ios xcode10 ios13 xcode11

8
推荐指数
1
解决办法
539
查看次数

标签 统计

ios ×1

ios13 ×1

xcode10 ×1

xcode11 ×1