This statement worked a few weeks ago and now is giving me a forward declaration error. The error reads "Reciever 'PFQuery' for class message is a forward declaration".
It also says for that same line
PFQuery *query = [PFQuery queryWithClassName:@"storeInfo"];
that no known class method for selector 'queryWithClassName' which is weird because I looked this up on Parse.com's documentation #import Parse/Parse.h which I did in this particular classes'.h file and the following PFQuery statements are the classic way to get an array with the information I need.
I tried looking up forward declaration and got a bit confused. Why am I getting this error?
Can anyone help me, possibly explain forward declaration as opposed to a standard declaration of a class?
This is an iOS Xcode project (Objective-C language) that is importing data from Parse.com. I appreciate any help on this and hints on where to look for answers.
- (NSMutableArray *) allStoreNames {
NSMutableArray *allStoreNames = [[NSMutableArray alloc] init];
PFQuery *query = [PFQuery queryWithClassName:@"storeInfo"];
[query whereKey:@"tag" equalTo:@"artistree"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (error) {
NSLog(@"Error: %@ %@", error, [error userInfo]);
} else {
for (PFObject *parseobject in objects) {
Store *store = [[Store alloc] initWithPFObject:parseobject];
NSString *storeString = store.name;
[allStoreNames addObject:storeString];
NSLog(@"%@ store name was added", store.name);
}
}
}];
return allStoreNames;
}