When I use Parse 1.8.5 to upload data to Parse, this cloud code has compile error in "params" that I cannot debug it.
let params = ["phoneNumber" : userPhoneNumber,
"username": username,
"password": userPassword,
"Email": userEmail
]
PFCloud.callFunctionInBackground("sendCode", withParameters: params, block:
{ (response: AnyObject?, error: NSError?) -> Void in
if response?.localizedDescription != nil {
print(error)
var alert = UIAlertView(title: "Failure", message: "SignUp Error", delegate: self, cancelButtonTitle: "OK")
alert.show()
} else {
self.activityIndicator.stopAnimating()
}
})
The error message says that there are optional types in the values of params
.
Make sure that all values are unwrapped.
I had the Same Problem in my project. i just changed my code from let parameters = ["email": mail,"password":passCode ]
to let parameters = ["email": mail as! AnyObject,"password":passCode as! AnyObject]
. Not sure if it affects anything else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With