- (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;
}跑步时:
NSArray *nib=[[NSBundle mainBundle] loadNibNamed:@"TodoTableViewCellController" owner:self options:nil];还有一个例外:*终止应用程序是由于未登录的异常'NSUnknownKeyException',原因:‘setValue:forUndefinedKey::这个类不符合键日期的键值编码。’
我不知道为什么会发生,所以请帮助我,谢谢你提前!
发布于 2012-03-24 14:26:43
此错误意味着您已将某些内容连接到nib中名为date的出口,但该出口不存在。你在哪里申报日期?
发布于 2015-03-05 22:34:33
UITableViewCell.
Custom Class设置为单元格的
Custom Class设置为自定义表,查看单元格类,在myCustomCell.h.
中查看myCustomCell.h.中的UIlabel
发布于 2012-03-24 14:25:01
连接TododTableViewController XIB中的所有出口(特别是视图出口),然后再次运行。
https://stackoverflow.com/questions/9852441
复制相似问题