キャッチされていない例外 '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;
}
それを解決する方法は?