如何在后台线程中使用方法MR_fetchAllSortedBy?
我试过了:
- (void)viewDidLoad
{
[super viewDidLoad];
[self loadFetchedResultsController];
}
- (void)loadFetchedResultsController
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),^{
_fetchedResultsController = [Podcast MR_fetchAllSortedBy:@"position"
ascending:YES
withPredicate:nil
groupBy:nil
delegate:self]
dispatch_async(dispatch_get_main_queue(),^{
if (![self.fetchedResultsController performFetch:&error])
{
[MagicalRecord handleErrors:error];
}
});
});
}
这些似乎已加载,但UITableView为空