カスタムセルの作成中に、次の例外に直面しています。
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<MasterTableView 0xb612b30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key address.'
私が使用しているデリゲート関数は次のとおりです。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *top=[[NSBundle mainBundle]loadNibNamed:@"CustomCell" owner:self options:nil];// on this line program received SIGABRT
for (id current in top) {
if ([current isKindOfClass:[UITableViewCell class]]) {
cell=(CustomCell *)current;
break;
}
}
}
// Configure the cell...
cell.name.text=@"name";
cell.address.text=@"Address";
return cell;
}
これに加えて、私は次の手順を実行しました。
- のファイル所有者
CustomCell.xib
にMasterTableView.h
- カスタムセルの出口を
MasterTableView.h
- 私は2つのためのアウトレットを与えまし
UILabel
たCustomCell.h
Cell
私はIBのセル識別子として与えました
私はDropboxでプロジェクト全体を共有しました。以下のリンクから入手できます。それも確認できます。何が悪いのか知りたい。
足りないステップを教えてください。よろしくお願いします。
PS:-プロジェクトでCoreDataを使用しました。コアデータがない場合、この手順で正しい出力が得られますが、このプロジェクトでは得られません。デフォルトのセルで確認しました。それはうまくいきました。