Click here to Skip to main content
14,271,765 members
Rate this:
Please Sign up or sign in to vote.
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
Posted
Updated 10-Apr-17 22:01pm
Comments
Richard MacCutchan 7-Nov-16 12:28pm
   
Check the documentation for the "Error" class.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Do one thing in the if statement try error as? NSError() .
if let error = error as? NSError() {
print("Error uploading: \(error.description)") 
return
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100