我正在使用NSFetchedResultsController来刷新表视图的数据.数据本身是通过在后台运行的 
 XML解析器提供的.解析器完成后,它会将数据保存到自己的上下文中. NSFetchedResultsController立即获取这些更改并开始调用 – (void)控制器:didChangeObject:atIndexPath:forChangeType:newIndexPath:每个更新元素的委托方法.这也很快,在日志文件中看起来完全正常. 
  
 
但是,在 – (void)controllerDidChangeContent:我调用UITableView的 – (void)endUpdates.然后我在屏幕上看到更新动画,但在所有单元格中,在最后一个只有一半可见的单元格旁边,唯一可见的是单元格左侧的图像.所有文字标签都不可见.它需要大约5到10秒,然后所有标签都可见.
但是,如果我忽略NSFetchedResultsController的所有委托调用,只需调用[self.tableView reloadData] on – (void)controllerDidChangeContent:一切正常,没有问题.内容立即存在.
有谁知道我在这里做错了什么?分析器显示主线程基本上什么都不做.除了调度到表视图的事件之外,还可以正确处理触摸事件.这些都没有处理.看起来表格视图正忙于做一些认真的工作,但我真的不知道那可能是什么,因为动画已经完成了.
这是我对NSFetchedResultsControllerDelegate的实现:
- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller {
    NSLog(@"%s",__PRETTY_FUNCTION__);
    [self.tableView beginUpdates];
}
- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id <NSFetchedResultsSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type {
    NSLog(@"%s",__PRETTY_FUNCTION__);
    switch(type) {
        case NSFetchedResultsChangeInsert:
            [self.tableView insertSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationAutomatic];
            break;
        case NSFetchedResultsChangeDelete:
            [self.tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationAutomatic];
            break;
    }
}
- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath*)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath*)newIndexPath {
    NSLog(@"%s",__PRETTY_FUNCTION__);
    UITableView* tableView = self.tableView;
    switch(type) {
        case NSFetchedResultsChangeInsert:
            [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
            break;
        case NSFetchedResultsChangeDelete:
    [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
            break;
        case NSFetchedResultsChangeUpdate:
    [(NewsItemCell*)[tableView cellForRowAtIndexPath:indexPath] updateWithNews:[self.fetchedResultsController objectAtIndexPath:indexPath]];
            break;
        case NSFetchedResultsChangeMove:
            [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
            [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
            break;
    }
}
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
    NSLog(@"%s",__PRETTY_FUNCTION__);
    [self.tableView endUpdates];
} 
 这是我的单元格布局的代码:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return self.fetchedResultsController.sections.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    id<NSFetchedResultsSectionInfo> sectionInfo = [self.fetchedResultsController.sections objectAtIndex:section];
    return sectionInfo.numberOfObjects;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    News* model = [self.fetchedResultsController objectAtIndexPath:indexPath];
    NewsItemCell* cell = (NewsItemCell*)[tableView dequeueReusableCellWithIdentifier:NewsCellReuseIdentifier];
    [cell updateWithNews:model];
    cell.accessoryType = (model.content ? UITableViewCellAccessorydisclosureIndicator : UITableViewCellAccessoryNone);
    return cell;
} 
 这个细胞非常基本的更新:
- (void)updateWithNews:(News*)news {
    Nsstring* dateString = [[NSDateFormatter outputDateFormatter] stringFromDate:news.date];
    self.headlineLabel.text = (news.headline ? news.headline : NSLocalizedString(@"<NewsNoHeadlineReplacement>",nil));
    self.MetaInfoLabel.text = [Nsstring stringWithFormat:NSLocalizedString(@"<NewsMetaInfoFormatDate>",nil),(dateString ? dateString : (NSLocalizedString(@"<NewsNoDateReplacement>",nil)))];
    self.readindicatorView.hidden = (news.read != nil && [news.read compare:news.parsingDate] == NSOrderedDescending);
} 
 占位符字符串也未显示.标签完全是空的.只有图像可见!
解决方法
 我先检查的事情: 
  
 
        >确保您的提取未在其他线程中执行>确保你的提取很快,如果它太慢也可能是原因