I am using parse for my iPhone app, and I am trying to fetch a PFObject using PFQuery. My query and other related code is as follows:
PFQuery *query = [PFQuery queryWithClassName:@"UserInfo"];
[query whereKey:@"userId" equalTo:@"89b7eb8801b24ace16b35b927ef01d4f"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
// The find succeeded.
NSLog(@"Successfully retrieved %d users.", objects.count);
} else {
// Log details of the failure
NSLog(@"Error: %@ %@", error, [error userInfo]);
}
}];
I tried using this method but I am getting 0 results in NSArray objects. While you can see in my data browser that there is one object matching the userId. I am able to add data in that class, but I am not able to retrieve it. Am I missing something? I am new at using Parse.

I got it. It was the anonymous user being created from my appDidFinishLaunching method.
This code was running which I wasn’t aware of:
Now, initially the [defaultACL setPublicReadAccess:YES]; line was commented. I studied a bit about users and anonymous users being created and uncommented this line, and it worked just fine exactly as I wanted. The PFQuery has started returning results. So, I am assuming the defaultACL value was the issue. Please correct me if wrong.