0
votes

I am trying to query my Parse "User" table using a objectId to get a specific row.

However I kept getting this error:

2016-01-08 22:03:50.476 ParseStarterProject-Swift[6278:3821859] [Error]: No results matched the query. (Code: 101, Version: 1.11.0)

Why is parse saying there is no results matched when the userObjectId var is clearly found in the objectId column of the Parse "User" table?

Parse User Table

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

    var cell = tableView.cellForRowAtIndexPath(indexPath)

    //place checkmark
    cell!.accessoryType = UITableViewCellAccessoryType.Checkmark

    //getting selected user parse objectId
    var userObjectId = userStructArray[indexPath.row].userId
    print(userObjectId) //prints hvPpO9XXtY

    var userQuery = PFQuery(className: "User")
    userQuery.getObjectInBackgroundWithId(userObjectId) { (userObject, error) -> Void in
        if error == nil && userObject != nil {
            print(userObject)
        } else {
            //print(error)
        }
    }
}

Thanks for your help.

1

1 Answers

2
votes

Change this line

  var userQuery = PFQuery(className: "User")

To

  var userQuery = PFQuery(className: "_User")