Ios 10 / XCODE 8.我的代码出错 [英] Ios 10/ XCODE 8. Error in my code

查看:124
本文介绍了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


这篇关于Ios 10 / XCODE 8.我的代码出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆