var user = PFUser()
user.username = username.text
user.password = password.text
user.signUpInBackgroundWithBlock {
(succeeded: Bool!, signupError: NSError!) -> Void in
self.activityIndicator.stopAnimating()
UIApplication.sharedApplication().endIgnoringInteractionEvents()
if signupError == nil {
// Hooray! Let them use the app now.
println("signed up")
我在 user.signUpInBackgroundWithBlock {
它说:
Function signature (Bool!, NSError!) -> is not compatible with expected type @obj_block (Bool, NSError!) - > Void
此代码来自教程视频。 Parse 当前的“Signing Up”代码看起来与这段代码不同
最佳答案
succeeded
应该是 bool 值而不是可选值。像这样删除感叹号:
(成功:Bool,注册错误:NSError!)
关于Swift - 解析 "Signing Up"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29994124/