TableView xibを使用していますが、すべてのデリゲートとデータソースが正常に実行されているようです。を設定self.textLabel.text
すると、テーブルビューの一般的な数が正しく表示されますが、カスタムTableViewCellを表示する必要があります。
tableviewcellだけを含むHistoryCell.xibを作成しました。UITableViewCellクラス「HistoryCell.h/HistoryCell.m」を作成しました。これは、HistoryCell.xibのファイル所有者として設定されています。UILabelsをHistoryCell.hに接続しました
UILabel statusLabel
UILabel nameLabel
UILabel timeLabel
私のメインのViewControllerクラスではcellForRowAtIndexPath
入れています
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"historyCellType";
HistoryCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[HistoryCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.nameLabel.text = @"Donald Duck";
return cell;
}
私は何が間違っているのですか?
ありがとう!