I am creating a custom class ChatRequest, but when I try to query it, it will not return any custom keys.
Here is my code:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
PFQuery *query = [PFQuery queryWithClassName:@"ChatRequest"];
[query setValue:[PFUser currentUser].username forKey:@"toUser"];
NSArray *objects = [query findObjects];
for (NSUInteger i = 0; i < objects.count; i++) {
PFObject *object = [objects objectAtIndex:i];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Chat Request!" message:object.sendingUser + @"wants to chat with you!" delegate:self cancelButtonTitle:@"Decline" otherButtonTitles:@"Accept", nil];
[alertView show];
}
}
Can anyone help? I checked that my class was correct and the keys were there, but it still won't work.