由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[setValue:forUndefinedKey:]:此类与键 buttonOfFirstView 的键值编码不兼容。”
为什么我会收到此错误?我正在尝试通过 XIB 制作一个表格单元格。添加此代码后,它会引发上述异常。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"MyCell";
MyTableViewCell *cell = (MyTableViewCell*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *arrayCellXib = [[NSBundle mainBundle] loadNibNamed:@"MyTableViewCell"
owner:self
options:nil];
....
}
.....
return cell;
}
如何解决?