UITableViewCell をカスタマイズしようとしていますが、何らかの理由で空白として表示されます。私が間違っていることは明らかですか?ストーリーボードから menuLabel をアウトレットとして引き出したので、正しく結び付けられ、ストーリーボードのセルはクラス「MenuCell」にリンクされています。
私のテーブルビューコントローラーで
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"MenuCell";
[self.tableView registerClass:[MenuCell class] forCellReuseIdentifier:CellIdentifier];
MenuCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil) {
NSLog(@"creating a new cell");
cell = [[MenuCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"MenuCell"];
}
cell.menuLabel.text = @"Hello";
return cell;
}