【发布时间】:2016-06-01 05:21:48
【问题描述】:
这是我的代码。错误:fatal error: unexpectedly found nil while unwrapping an Optional value
(lldb)我不知道哪里出了问题
res = "https://www.example.com/range.php?arr1=48.15&arr2=48.15&API_KEY=>code"
let url = NSURL(string: res)! // error line
print("url craeted" + res)
return url
【问题讨论】:
-
>不是 URL 的有效字符。对您的 URL 进行编码:stackoverflow.com/q/24551816/2227743、stackoverflow.com/a/30149081/2227743 等