3

I am using Parse and I have a signup page where I call:

user.signUpInBackgroundWithBlock { (succeeded: Bool, error: NSError?) -> Void in

I checked and this works on previous versions of Xcode, however there was a similar problem when Swift 1.2 came out, though it doesn't solve my problem.

The error I get is:

Cannot invoke 'signupInBackgroundWithBlock' with an argument list of type: '((Bool, NSError?) -> Void )'

I'd be grateful for any help.

1 Answer 1

4

You should change the type of succeeded value to ObjCBool. The signature of PFBooleanResultBlock now changed (Bool, NSError?) -> Void to (ObjCBool, NSError?) -> Void

So you should change the type Bool to ObjCBool, like below:

user.signUpInBackgroundWithBlock { (succeeded: ObjCBool, error: NSError?) -> Void in
    print(succeeded)
    print(error)
}

or just remove the type to make the compiler inferring the type.

user.signUpInBackgroundWithBlock { (succeeded, error) -> Void in
    print(succeeded)
    print(error)
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.