【问题标题】:NSURLSession from macos Sharing Extension来自 macOS 共享扩展的 NSURLSession
【发布时间】:2017-08-25 12:46:32
【问题描述】:

我在func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { URLSessionDataDelegate 方法中收到此错误:

error=可选(错误域=NSURLErrorDomain 代码=-1 “未知错误” UserInfo={NSErrorFailingURLKey=https://www.example.com/, NSLocalizedDescription=未知错误, NSErrorFailingURLStringKey=https://www.example.com/})

非常相似的代码可以在应用程序中完美运行,但我正在尝试编写一个共享应用程序扩展来上传到网络服务器。

我使用的 URLSessionConfiguration.background(withIdentifier:"...") 与我的桌面应用程序相同。

为什么我得到 erorr -1?

【问题讨论】:

    标签: macos nsurlsession macos-app-extension


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2016-02-21
    • 1970-01-01
    • 2018-08-02
    • 2016-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多