Ios 10 / XCODE 8.我的代码出错
问题描述:
您好。我在第2行的代码中收到错误。我正在使用Xcode 8.
错误代码是:(类型错误的值没有成员描述)
如果让错误=错误{
print(错误上传:\(error.description))
return
我尝试了什么:
找不到任何解决办法来解决这个问题。需要帮助
Hi. I am getting error in this code the line 2. I am using Xcode 8.
Error code is: ( Value of type "Error" has no member "description)
if let error = error {
print("Error uploading: \(error.description)")
return
What I have tried:
Not found any solution to fix that. Need help
答
if语句中的一件事尝试错误为?NSError()。
Do one thing in the if statement try error as? NSError() .
if let error = error as? NSError() {
print("Error uploading: \(error.description)")
return