In my UIViewController
I am trying to query my parse server, but I keep getting a return of 0 for it, though I know 100% that this class does have objects in it. Any thoughts?
PFQuery *query = [PFQuery queryWithClassName:@"General"];
int i;
for (i = 0; i < [follows count]; i++) {
[query whereKey:@"Session" containedIn:follows];
}
query.cachePolicy = kPFCachePolicyCacheThenNetwork;
[query orderByDescending:@"createdAt"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
// it never gets here...
NSLog(@"OBJECTS%@", objects);
if (!error) {
NSLog(@"Successfully retrieved %lu objects.", (unsigned long)objects.count);
for (PFObject *object in objects) {
NSLog(@"%@", object.objectId);
}
// [self gotoMain];
} else {
NSLog(@"Error: %@ %@", error, [error userInfo]);
}
}];
It tells me there is no error that it successfully retrieved 0 objects in my console.
whereKey
andorderBy
. Try with a different class name. This will help us pinpoint the issue. – Warrior[query whereKey:@"Session" containedIn:follows];
, does it work? What isfollows
? – Slyke[query whereKey
has nothing to do with the issue. I've tried it with it in there, and I've tried it with removed, and it has no effect. The issue has to do with calling this, I suspect, from a ViewController and not a PFQueryTableViewController, but please...STOP ASKING ME ABOUT THAT ONE LINE AND IF REMOVING IT CHANGES ANYTHING! Look through comments and answers, it's been suggested countless times, so quit asking the same thing!!!!!!! – Escudo