Skip to content

Instantly share code, notes, and snippets.

@matteom
Last active December 28, 2015 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matteom/7549131 to your computer and use it in GitHub Desktop.
Save matteom/7549131 to your computer and use it in GitHub Desktop.
Fetching the leads from core data to display in the table view
- (void)updateLeads {
NSFetchRequest *leadsFetchRequest = [NSFetchRequest fetchRequestWithEntityName:[PCLead entityName]];
leadsFetchRequest.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"surname" ascending:YES]];
self.leads = [self.managedObjectContext executeFetchRequest:leadsFetchRequest error:NULL];
[self.tableView reloadData];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment