[英]Getting data out of custom UITableViewCell and back into UITableViewController
[英]UITableViewController with custom UITableViewCell
我很好奇为什么在自定义控制器上的tableview单元格时会出现SIGABRT错误。 Cell是在UITableViewCell
类中创建的,所有链接都是我能看到的。 UITableViewController
不是rootController,而是一个关闭另一个UITableViewController
根的控制器。 所以RootView - > TableViewCont - >这个TableViewCont。
错误在cellForRowAtIndexPath
函数中:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:
(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"CellTest";
CellTest *cell = (CellTest *)
[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle]
loadNibNamed:@"CellTest" owner:self
options:nil];//**error is thrown here**//
for(id currentObject in topLevelObjects){
if([currentObject isKindOfClass:[UITableViewCell class]]){
cell = (CellTest *) currentObject;
break;
}
}
}
// Configure the cell...
cell.cellTitle.text = @"Test";
cell.cellDescription.text = @"little detail";
return cell;
}
这是gdb日志中的错误:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<DemoViews 0x6b16ce0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key cellDescription.
我有同样的问题,不明白为什么我得到SIGABRT。 但是我解决了这个问题:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.