Created
October 18, 2010 15:06
-
-
Save jakemarsh/632351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; | |
NSEntityDescription *entity = [NSEntityDescription entityForName:@"PKScan" inManagedObjectContext:self.managedObjectContext]; | |
[fetchRequest setEntity:entity]; | |
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"scanTimestamp" ascending:NO]; | |
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; | |
[fetchRequest setSortDescriptors:sortDescriptors]; | |
[fetchRequest setFetchBatchSize:20]; | |
NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest | |
managedObjectContext:self.managedObjectContext | |
sectionNameKeyPath:@"scanTimestamp.prettySectionHeaderDateSring" | |
cacheName:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment