- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *TodoListTableIdentifier = @"TodoListTableIdentifier";
TodoTableViewCellController *cell = (TodoTableViewCellController *)[tableView dequeueReusableCellWithIdentifier:TodoListTableIdentifier];
if (cell == nil)
{
NSArray *nib=[[NSBundle mainBundle] loadNibNamed:@"TodoTableViewCellController" owner:self options:nil];
cell=[nib objectAtIndex:0];
[cell setSelectionStyle:UITableViewCellSelectionStyleGray];
}
Todo *todo = [self.allTodoArray objectAtIndex:[indexPath row]];
cell.titleLabel.text = todo.fileTitle;
cell.money.text = [NSString stringWithFormat:@"Monei:%f",todo.amount];
cell.name.text = todo.realName;
cell.date.text = todo.operateTime;
return cell;
}
जब चल रहा है:कस्टम UITableViewCell NSUnknownKeyException
NSArray *nib=[[NSBundle mainBundle] loadNibNamed:@"TodoTableViewCellController" owner:self options:nil];
और वहाँ एक अपवाद है: * समाप्त एप्लिकेशन न आया हुआ अपवाद 'NSUnknownKeyException', कारण की वजह से: '[setValue: forUndefinedKey:]: इस कुंजी महत्वपूर्ण तारीख के लिए महत्वपूर्ण मूल्य कोडिंग-अनुरूप नहीं है। '
मुझे नहीं पता कि ऐसा क्यों होता है, इसलिए कृपया इसके साथ मेरी मदद करें, अग्रिम धन्यवाद!
संभावित डुप्लिकेट [यह वर्ग कुंजी के लिए महत्वपूर्ण मूल्य कोडिंग-अनुरूप नहीं है] (http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant -for-the-key) – jtbandes