The trick is to use PFQuery includeKey
to have the related pointer data automatically filled by Parse.
The user
data will be downloaded without requiring you to make another query for it.
PFQuery *query = [PFQuery queryWithClassName:@"Post"];
// Include the user data with each post
[query includeKey:@"title_of_userpointer_column"];
[query findObjectsInBackgroundWithBlock:^(NSArray *postObjects, NSError *error)
{
if (!error) {
NSLog(@"Successfully retrieved: %d items", [postObjects count]);
// postObjects now contains the latest 100 Posts, and the "title_of_userpointer_column" field
// has been populated.
// For example:
for (PFObject * postObject in postObjects) {
// This does not require a network access.
PFObject *postAuthor = [postObject objectForKey:@"title_of_userpointer_column"];
NSLog(@"retrieved related Post Author: %@", postAuthor);
}
}