gpt4 book ai didi

swift - 参数标签(_ :, 目标)与可用重载不匹配

转载 作者:行者123 更新时间:2023-11-30 11:32:03 25 4
gpt4 key购买 nike

我正在尝试将我的代码从 Swift 2 迁移到 Swift 3。这是我使用 Alamofire 恢复数据的代码:

public func download(resumeData: NSData, destination: Request.DownloadFileDestination) -> Request {
return download(.ResumeData(resumeData), destination: destination)
}

在构建时,错误显示为:

Argument Labels (_:, destination) do not match available overloads

最佳答案

这是 swift 3.0 的正确迁移

        let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory)

Alamofire.download(resumingWith: Data, to: destination)

关于swift - 参数标签(_ :, 目标)与可用重载不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50161079/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com