我的应用程序有一个带有 PrototypeCells (CustomCells) 的 TableView。有 4 个部分,每个部分只有一行。前三个单元格是相同的,它们都有一个 UITextField (tradeTextField)。但是第四个单元格 (Class ResultCell) 在中间有一个自定义标签。在 InterfaceBuilder 中,我将 Prototype Cell 的数量设置为两个,并将 Basic Class 更改为 ResultCell,并将标识符更改为 resultCell。现在我收到了错误
this class is not key value coding-compliant for the key tradeTextField.'
这里是 cellForRowAtIndexPath 方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.section == 3) //Here i'm getting the error
{
ResultCell *cell = [tableView dequeueReusableCellWithIdentifier:@"resultCell" forIndexPath:indexPath];
cell.resultLabel.text = @"Test";
return cell;
}
else
{
TradeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"tradeCell" forIndexPath:indexPath];
return cell;
}
}
谁能帮帮我?
最佳答案
尝试检查您的 Storyboard是否存在与 IBOulet 的不存在连接。如果您在代码中删除 socket ,来自 IB 的连接仍然存在。
关于ios - 此类对于键 tradeTextField 不符合键值编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22044454/