Glama
Aug 12, 2009, 09:08 PM
Hello!
I am trying to follow Apple's guide to Core Data. In one of their sample programs, they have this 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?
I am trying to follow Apple's guide to Core Data. In one of their sample programs, they have this 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?
