セルの構成機能からエンティティの値を更新することは可能ですか? 数値が他の数値よりも大きい場合、エントリ属性の値を変更したいと考えています。これは私がこれまでに持っているものですが、エラーでアプリがクラッシュします:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[<Outgoing 0x7fbcf3141890> setValue:forUndefinedKey:]: the entity Outgoing
is not key value coding-compliant for the key "goingover".'
私のconfigurecellメソッド:
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath {
Outgoing *outgoing = [self.fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = outgoing.costDescription;
cell.detailTextLabel.text = [NSString stringWithFormat:@"%.2f",[outgoing.amount floatValue]];
if (self.incomingTotal > self.outgoingTotal) {
[outgoing setValue:@"no" forKey:@"goingover"];
}
if ([outgoing.goingOver isEqualToString:@"yes"]) {
cell.backgroundColor = [UIColor redColor];
}else{
cell.backgroundColor = [UIColor lightGrayColor];
}
}