微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法打开网址

如何解决无法打开网址

我有以下代码

Failed to load interface for ‘Data.Random’
Perhaps you meant Data.Ratio (from base-4.9.0.0)
Use -v to see a list of the files searched for.

我得到的错误

let reachUrl = "https://helpers.pythonanywhere.com/load-data/announcements?key=\(key)&data=[\"\(nameTF.text!)\",\"\(infoTF.text!)\",\"\(pickerView.selectedRow(inComponent: 0))\"]"
        
UIApplication.shared.open(URL(string: reachUrl.addingPercentEncoding(withAllowedCharacters: .alphanumerics)!)!)

错误显示在控制台中,应用程序本身没有执行任何操作。

我想知道怎么回事。感谢您的帮助

解决方法

我知道问题出在哪里,请您试试下面的代码,让我知道它是否有效。

let reachUrl = "https://helpers.pythonanywhere.com/load-data/announcements?key=\(key)&data=[\"\(nameTF.text!)\",\"\(infoTF.text!)\",\"\(pickerView.selectedRow(inComponent: 0))\"]"
        
UIApplication.shared.open(URL(string: reachUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)!)

谢谢, 快乐编码。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。