I have an Entity 'Event' which contains a NSDate 'AccidentDate'. I am trying to do a fetch request to grab only the most recent 'AccidentDate' but I am not sure how to set up the predicate to grab only the last 'AccidentDate'
Below is my code so far...
NSFetchRequest *fetchRequest1 = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:self.managedObjectContext];
[fetchRequest1 setEntity:entity];
NSPredicate *predicate; //unknown code here [fetchRequest1 setPredicate:predicate];
NSArray *items = [self.managedObjectContext executeFetchRequest:fetchRequest1 error:&error];
[fetchRequest1 release];
Any help would be greatly appreciated. Thanks