【问题标题】:URLSession produces '()', not the expected contextual result typeURLSession 产生'()',而不是预期的上下文结果类型
【发布时间】:2017-09-06 17:24:58
【问题描述】:

任何线索为什么我会收到错误“'URLSession' 产生 '()',而不是预期的上下文结果类型 'URLSession'”以下行 -

internalSession = URLSession(configuration: URLSessionConfiguration.default)

我正在使用最新的 Xcode 和 swift 3。我在 stackoverflow 上找到了类似的问题和答案并尝试了它们,但它们没有有效/可接受的答案。

请帮忙。

【问题讨论】:

    标签: ios swift3


    【解决方案1】:

    请检查您的 URLSessionTaskDelegate 或 URLSessionDelegate 的委托方法,并尝试按照 swift 3 进行匹配。这对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-21
      • 1970-01-01
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 1970-01-01
      • 2019-04-08
      • 1970-01-01
      相关资源
      最近更新 更多