gpt4 book ai didi

swift - 字符串(contentsOfURL :) in Swift 3

转载 作者:行者123 更新时间:2023-11-30 12:27:47 24 4
gpt4 key购买 nike

之前的代码:

if let resultOfURL = try? String(contentsOfURL:myURL!, encoding: String.Encoding.utf8) {

现在抛出此错误:

'init' has been renamed to 'init(describing:)'

有什么帮助吗?非常感谢!!

最佳答案

根据the Swift 3 Migration Guide ,

Users may need to manually migrate calls to String(contentsOfURL:usedEncoding:) to String(contentsOf:usedEncoding:)

关于swift - 字符串(contentsOfURL :) in Swift 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43960241/

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