I'm trying to fetch data from 5 different classes on Parse using the same PFQuery
.
Most of the classes have more than 100 objects in it, but apart from the first class I fetch all the other classes (that have more than 100 objects) returns just 100.
*The first class that I fetch from returns the correct number, after it, just 100.
My code:
PFQuery *query=[PFQuery queryWithClassName:@"Music"]; // 216 objects in class
query.limit=1000;
[query findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {
if (error) {
NSLog(@"Error: %@",[error description]);
}
//"objects"'s count: 216 objects
}];
query=[PFQuery queryWithClassName:@"Movies"]; //95 objects in class
[query findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {
if (error) {
NSLog(@"Error: %@",[error description]);
}
//"objects"'s count: 95 objects
}];
query=[PFQuery queryWithClassName:@"Theater"]; //288 objects in class
[query findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {
if (error) {
NSLog(@"Error: %@",[error description]);
}
//"objects"'s count: 100 objects
}];
query=[PFQuery queryWithClassName:@"Food"]; //558 objects in class
[query findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {
NSLog(@"Objects count: %lu",objects.count);
if (error) {
NSLog(@"Error: %@",[error description]);
}
//"objects"'s count: 100 objects
}];
query=[PFQuery queryWithClassName:@"Toys"]; //21 objects in class
[query findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {
if (error) {
NSLog(@"Error: %@",[error description]);
}
//"objects"'s count: 21 objects
}];
I'll be really thankful if someone could help me with this problem, Thank you!