0

I have the following code, which is expected to perform a query in the User table to find the row which has an email equal to "test@live.com" and signedUpWith to "facebook" as shown below:

var userQuery = PFQuery(className: "User")

    userQuery.whereKey("email", equalTo: "test@live.com")
    userQuery.whereKey("signedUpWith", equalTo: "facebook")


    var userResults: [PFObject]? = nil

    do {
        userResults = try userQuery.findObjects()
    } catch  {

    }

However for some reason, when printing the userResults.count gives 0 and the userResults object is nil.

BTW: these values EXIST in my table row

Does anyone understand why?

JAL
  • 41,701
  • 23
  • 172
  • 300
KTOV
  • 559
  • 3
  • 14
  • 39

1 Answers1

2

You have to use PFQuery(className: "_User") since it's a designated Parse class.

More appropriately, you should be using var userQuery = PFUser.query

Alexander Li
  • 781
  • 4
  • 12