Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Glama

macrumors member
Original poster
Hello!
I am trying to follow Apple's guide to Core Data. In one of their sample programs, they have this code:

Code:
NSManagedObjectModel *model = ...;

NSError *error;

NSDictionary *substitutionDictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"Fiona", @"FIRST_NAME", @"Verde", @"LAST_NAME", [NSDate dateWithTimeIntervalSinceNow:-31356000], @"DATE", nil];
NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"PublicationsForAuthorSinceDate" substitutionVariables:substitutionDictionary];

NSArray *results = [aManagedObjectContext executeFetchRequest:fetchRequest error:&error];

I dont even know if this code is reading from the store or writing to it. It seems like a "fetch" would be for reading, but data values are specified (hard coded) so it must be writing it. Am I correct?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.