coderlyfe
coderlyfe

Reputation: 206

Parse Query Constraint Contained In Not Returning Objects

I am trying to run this query however it is returning no objects. Any help?

    for (int arrayIndex=0; arrayIndex<[self.cards count]; arrayIndex++)
{
    NSString *senderId = [[deck objectAtIndex:arrayIndex]objectForKey:@"SenderId"];
    [list_of_sender_ids addObject:senderId];
}
PFQuery *query = [PFQuery queryWithClassName:@"User"];
[query whereKey:@"facebook_id" containedIn:list_of_sender_ids];
    [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {

Upvotes: 0

Views: 307

Answers (1)

BHendricks
BHendricks

Reputation: 4493

A couple of things that could be going wrong right off the bat: First of all, to query the user class, you shouldn't use

PFQuery *query = [PFQuery queryWithClassName:@"User"];

But instead,

PFQuery *query = [PFUser query];

Assuming your User class still returns PFUser objects. Another thing to make sure is right is the @"Facebook_id" key, and confirm in Parse that this is a top level key that you can see on your Parse User objects. Lastly, make sure @"SenderId" is also the right key on the objects in deck, since you seem not to be querying based on the same key that could cause the issue.

Upvotes: 2

Related Questions