I've added the following to the AppDelegate in the Core Data Recipes example, but I don't get any printed result in the Console...any ideas?
#pragma mark -
#pragma mark TESTING RETRIEVAL OF RECIPE NAMES
- (NSArray *)allRecipes{
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"name" inManagedObjectContext:self.managedObjectContext];
[request setEntity:entity];
NSArray *result = [[NSArray alloc] init];
result = [self.managedObjectContext executeFetchRequest:request error:NULL];
NSManagedObject *firstObject = [result objectAtIndex:0];
NSLog(@"firstObject.name: %@", [firstObject valueForKey:@"name"]);
}
XCode gives me a warning after this method: "Control reaches end of non-void function"
I think that means I'm not getting any results...which is obvious, because nothing is printing.