我正在尝试在我的应用中实现注册方法,现在我遇到了解析问题。我正在尝试以下方法:
func signUpSend() {
var user = PFUser()
user.username = email.text
user.password = email.text
user.password = password.text
user.signUpInBackgroundWithBlock {
(succeeded: Bool!, error: NSError!) -> Void in
if error == nil {
// Hooray! Let them use the app now.
} else {
let errorString = error.userInfo["error"] as NSString
// Show the errorString somewhere and let the user try again.
}
}
}
signUpInBackgroundWithBlock给我一个错误"无法调用' signUpInBackgroundWithBlock'使用类型'((Bool!,NSError!) - > Void)的参数列表' 。我试图在解析文档中找到答案,但这正是他们建议使用的代码。有谁知道如何解决这个问题?
谢谢!
答案 0 :(得分:1)
尝试更改:
(succeeded: Bool!, error: NSError!) -> Void in
到
(succeeded, error) -> Void in
我认为由于Swift 1.2更新中的更改而需要进行此更改