NSFetchedResultsController在后台通过MagicalRecord

时间:2013-12-26 16:53:18

标签: core-data magicalrecord

如何在后台线程中使用方法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为空

0 个答案:

没有答案