Nested Include Parse.com

ios, objective-c, parse-platform

Solution

This will work.

PFQuery *query = [PFQuery queryWithClassName:@"UserToMessage"];
[query includeKey:@"msg"];
[query includeKey:@"msg.creator"];

// Add constraints on query
...
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    if(error) return;
    // Do action
    ...
}];

Problem

I have a `UserToMessage` table which has a pointer to user called `thisUser` and a pointer to message called `msg` The `message table` has a pointer to user called `creator`. When I query `UserToMessage` I `[includeKey:@"message"]` I also want to `[includeKey:@"creator"]` somehow...

Original source