0

I am using a PFQueryTableViewController and I am querying PFObjects called Group. These groups objects all have relations to a User PFObject. I want to add constraints to this query by querying only the groups that have relations containing the current user. How do I add constraints to a query by only returning objects that contain the current user in the relation?

            -(PFQuery *)queryForTable{
            PFQuery * query = [PFQuery queryWithClassName:@"Group"];
    //Users is a relation
            [query whereKey:@"Users" equalTo:[PFUser currentUser]];
//This crashes the app
//I need to return only objects with current user in the users relation
            return query;
        }

Thanks

random_0620
  • 1,636
  • 5
  • 23
  • 44

0 Answers0