Objective c NSFetchedResultsController返回具有null属性的对象

Objective c NSFetchedResultsController返回具有null属性的对象,objective-c,ios,cocoa-touch,core-data,Objective C,Ios,Cocoa Touch,Core Data,因此,我对核心数据使用mogenerator,当我第一次加载tableview时,resultsController返回具有有效属性的良好对象。但是当我滚动表格时,所有重新加载的单元格都填充了从resultsController返回的具有null属性的对象。这是缓存问题吗 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { sta

因此,我对核心数据使用mogenerator,当我第一次加载tableview时,resultsController返回具有有效属性的良好对象。但是当我滚动表格时,所有重新加载的单元格都填充了从resultsController返回的具有null属性的对象。这是缓存问题吗

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    // Configure the cell...
    Log *log = [self.resultsController objectAtIndexPath:indexPath];
    cell.textLabel.text = [NSString stringWithFormat:@"%@", log.text];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    return cell;
}

事实证明,我不应该将resultsController放在viewWillLoad或viewDidLoad中。我把它放在它自己的访问方法中,现在可以正常工作。

如果不查看您的代码,就看不见,尤其是CellForRowatineXpath