我在我的应用程序中使用自定义单元格(friendListCell)。当我运行这个IOS 8后来它工作,但在IOS 7它崩溃并显示如下错误。我无法找出错误的地方存在,应用程序崩溃IOS 7工作IOS 8
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UILabel 0x17892a10> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key keyPath.'
下面的代码,
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
return cell;
}
注: 我删除所有的引用,即使它会显示错误这种细胞。
向我们展示一些代码,并指出崩溃发生的位置。请注意,您可能需要启用异常断点来查看触发异常的原因。 – jcaron
您可能试图设置文本而不引用Label的文本属性...您必须在某处执行'lblTitle = @“data”'而不是'lblTitle.text = @“data”'.. – Dalvik
请参阅我的更新代码和断点显示错误,当涉及到下面的行,单元格= [tableView dequeueReusableCellWithIdentifier:@“cell”forIndexPath:indexPath]; –