クラス MTTableViewCell があります: UITableViewCell クラスの init メソッドは次のとおりです: backgroundcolor を紫に設定していることに注意してください。
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if(self)
{
[self setBackgroundColor:[UIColor purpleColor]];
}
return self;
// return [self initMVTableViewCellWithStyle:style reuseIdentifier:reuseIdentifier cellColor:nil];
}
テーブルビューのデリゲートから次のメソッドを呼び出します
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString* identifier = @"one";
[self.tableView registerClass:[MVTTableViewCell class] forCellReuseIdentifier:identifier];
MVTTableViewCell *cell = [[MVTTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
cell.textLabel.text = [self->datasource objectAtIndex:[indexPath row]];
return cell;
}
ただし、テーブル ビュー セルの色に変化は見られません。何がうまくいかないのですか?