I'm assuming you've read this tutorial.
CoreData uses a mechanism known as "faulting" to reduce the application's memory usage.
From Apple's docs:
"A fault is a placeholder object that represents a managed object that has not yet been fully realized, or a collection object that represents a relationship"
What this means is that when you read an Entity from CoreData it does not reads the entire object graph just to populate that one Entity.
In your case, if you read a "Post" entity it won't read all the comments related to that post. This is true even when you're using StackMob as the DataStore.
I made a very small project just to test this and this is what I got. By using the sniffer Charles I was able to see the request/response of the fetch.
Here is the query I used:
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Post" inManagedObjectContext:self.managedObjectContext];
[fetchRequest setEntity:entity];
[self.managedObjectContext executeFetchRequest:fetchRequest onSuccess:^(NSArray *results) {
for (NSManagedObject *managedObject in results) {
NSArray *comments = [managedObject valueForKey:@"comments"];
NSLog(@"Post comments: %d", comments.count);
}
} onFailure:^(NSError *error) {
NSLog(@"Error fetching: %@", error);
}];
And here is the response I got (from using Charles)
[
{
"post_id": "85FC22A1-92ED-484B-9B52-78CBFE464E5D",
"text": "Post1",
"lastmoddate": 1370916620273,
"createddate": 1370915371016,
"comments": [
"5F421C86-F7E7-4BAD-AB21-F056EB7D9451",
"C1CD96E2-856A-43F0-A71D-09CF14732630",
"BAD9F652-C181-4AA1-8717-05DD5B2CA54E",
"AC7D869B-A2BD-4181-8DCF-21C8E127540F",
"2D1A1C80-9A80-48AE-819D-675851EA17D6"
]
},
{
"post_id": "8A84BE1B-6ECE-4C49-B706-7981490C5C2E",
"text": "Post2",
"lastmoddate": 1370916678114,
"createddate": 1370915379347,
"comments": [
"3C001706-2D91-4183-9A07-33D77D5AB307",
"E7DC3A89-2C3D-4510-83E5-BE13A9E626CF",
"2874B59C-781B-4605-97C7-E4EF7965AF4E"
]
},
{
"post_id": "13E60590-E4E7-4012-A3E2-2F0339498D94",
"text": "Post3",
"lastmoddate": 1370916750434,
"createddate": 1370915398649,
"comments": [
"AEA3E5E3-E32E-4DAA-A649-6D8DE02FB9B2",
"DFCBD7E2-9360-4221-99DB-1DE2EE5590CE",
"484E6832-3873-4655-A6C1-0303A42127D9",
"B2316F8B-0AAF-451F-A91C-9E8B4657B1A5"
]
}
]
As you can see from the response, all of the "comments" arrays have the 'Id' of the comment stored in StackMob, but it doesn't have the actual comment.
Hope this helps!