Skip to content

Parse issue in Swift 3 #2718

Closed
Closed

Description

@carjo422

Hi, I setup my parse solution using Swift 2. After updating Xcode and converting to Swift 3 I get the following error on my code:

let query = PFQuery(className: "gameScore")

    query.order(byDescending: "score")
    query.findObjectsInBackgroundWithBlock {(objects: [PFObject]?, error: NSError?) -> Void in

Cannot convert value of type '([PFObject]?, NSError?) -Z Void' to expected argument type '([PFObject]?, NSError?) -> Void?

Anyone with any ideas on this issue??
Thanks!

Activity

  1. mtrezza commented on Sep 16, 2016

    @mtrezza
    Member

    Try replacing error: NSError? with error: Error?.

  2. carjo422 commented on Sep 17, 2016

    @carjo422
    Author

    Awesome! This was the key to solve it!

  3. mtrezza commented on Sep 17, 2016

    @mtrezza
    Member

    Glad I could help :-) I suggest you post general questions regarding code migration to Swift 3 on Stackoverflow where you have a great developer community helping you out.

    If you think you found a bug in parse server, have any feature suggestions or want to contribute to parse server code then this here is the place to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions