title: parse.com: How to compare pointer-keys with objects?
body: <p>I am using the backend service parse.com for a iOS app and I have a problem with querying it properly. I need help with the method whereKey:matchesKey:inQuery;</p>
  
  <p>I have this code:</p>
  
  <pre><code>//NOT WORKING
  PFQuery *query1 = [PFQuery queryWithClassName:@"Object"];
  
  PFQuery *query2 = [PFQuery queryWithClassName:@"ObjectsRelations"];
  [query2 whereKey:@"user" equalTo:[PFUser currentUser]];
  
  [query1 whereKey:@"objectId" matchesKey:@"objectPointer" inQuery:query2];
  [query1 findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
      // No objects
  }];
  </code></pre>
  
  <p>It is not working the way I want. I have tried several ways for it to compare the key "objectPointer" in class "ObjectsRelations" (which is a pointer to an instance of class Object) to the actual Object in query 1. I do not get any objects back, because the comparison does not work as I want, since the key objectId is just a string and the key objectPointer is a pointer to a Object.</p>
  
  <p>When I run this code, I get the intended result, but this requires me to do two api-requests to get the actual objectId as a string!</p>
  
  <pre><code>//WORKING
  PFQuery *query = [PFQuery queryWithClassName:@"Object"];
  
  PFQuery *query2 = [PFQuery queryWithClassName:@"ObjectRelations"];
  [query2 whereKey:@"user" equalTo:[PFUser currentUser]];
  
  [query2 findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
      PFObject *firstObject = [((PFObject*)[objects firstObject]) objectForKey:@"objectPointer"];
  
  [query whereKey:@"objectId" equalTo:firstObject.objectId];
  
  [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
      //Getting the objects correctly from the class Object!
  }];
  }];
  </code></pre>
  
  <p>How to do this with a single api-request? How to compare a instance of a Class to a pointer of a class with a query?</p>
  
  <p>Something like this is what i want to do: (Pseudo Code)</p>
  
  <pre><code>[query1 where:SELF matches:@"objectPointer" inQuery:query2];
  </code></pre>
  
  <p>Any suggestions?</p>