Created
August 9, 2014 20:14
-
-
Save quellish/2bb54c9d809f1c37155b to your computer and use it in GitHub Desktop.
Asynchronous fetch with an NSFetchedResultsController
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
[[[self fetchedResultsController] managedObjectContext] performBlock:^{ | |
NSError *fetchError = nil; | |
if (![self fetchedResultsController] performFetch:&fetchError]){ | |
/// handle the error. Don't just log it. | |
} else { | |
// Update the view from the main queue. | |
[[NSOperationQueue mainQueue] addOperationWithBlock:^{ | |
[tableView reloadData]; | |
}]; | |
} | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment