I need to do a query on an object in parse to see either of 2 fields contain a value. The value is a PFUser object. I presume I need some kind of OR statement but I don't know how to do that.
Here's the code I have so far..
PFQuery *query = [PFQuery queryWithClassName:@"GameTradeObject"];
[query whereKey:@"region" equalTo:[NSNumber numberWithInt:region]];
[query whereKey:@"fromUser" equalTo:[PFUser currentUser]];
[query whereKey:@"toUser" equalTo:[PFUser currentUser]];
[query includeKey:@"fromUser"];
[query includeKey:@"fromVillage"];
[query includeKey:@"toUser"];
[query includeKey:@"toVillage"];
[query findObjectsInBackgroundWithBlock:^(NSArray *PUObjects, NSError *error) {
if (!error) {
What I need is to know if the current user Object exists in either of the fromUser or toUser fields. I think it might have to be done with an NSPredicate but I don't know how to build the statement.