I quickly put together a model for you:

, "" - , " " - " ". .
"Pet". , , . " " "". . , "Pet" , //.
, (, "Pet" " ", "" "" ) "Pet", , "" "barkSound", "Cat" "meowSound".
, , , .
, . " ", NSS . .
, , :
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Person" inManagedObjectContext:yourContext];
[fetchRequest setEntity:entity];
NSError *error = nil;
NSArray *fetchedObjects = [yourContext executeFetchRequest:fetchRequest error:&error];
if (fetchedObjects == nil) {
}
[fetchRequest release];
for (Person* person in fetchedObjects)
{
NSLog(@"Hello, my name is %@", person.name);
for (Pet* pet in person.pets) {
if ([pet isKindOfClass:[Dog class]])
{
NSLog(@"Woof, I'm %@, owned by %@", pet.name, pet.owner.name);
}
else
{
NSLog(@"Meow, I'm %@, owned by %@", pet.name, pet.owner.name);
}
}
}
, , :
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Pet" inManagedObjectContext:yourContext];
[fetchRequest setEntity:entity];
[fetchRequest setIncludesSubentities:YES];
NSError *error = nil;
NSArray *fetchedObjects = [yourContext executeFetchRequest:fetchRequest error:&error];
if (fetchedObjects == nil) {
}
[fetchRequest release];
, , .