UITableViewCell
label や a などの要素を持つカスタムを作成segmentcontrol
しましたが、要素内の要素にアクセスしようとすると、cellforrowatindexpath
メモリが割り当てられません。セル インスタンスにはメモリが割り当てられています。私はxibをチェックし、アウトレットを接続しました。ここにコードがありますcellforrowatindexpath
-
SegmentCell *cell;
[tableView registerNib:[UINib nibWithNibName:@"SegmentCell" bundle:nil] forCellReuseIdentifier:@"SegmentCell"];
[tableView registerClass:[SegmentCell class] forCellReuseIdentifier:@"SegmentCell"];
cell = (SegmentCell *)[tableView dequeueReusableCellWithIdentifier:@"SegmentCell" forIndexPath:indexPath];
cell.title.text=@"Hell*emphasized text*o";
return cell;
タイトルは、印刷の説明で nil を示すラベルです