title: UITableViewCell subclass
body: <p>I have this code segment:</p>
  
  <pre><code>if (cell == nil)
  {
      CGRect cellFrame = CGRectMake(0,0,300,250);
      cell = [[UITableViewCell alloc] initWithFrame:cellFrame
              reuseIdentifier:CellTableIndetifier];
  
      CGRect nameLabelRect = CGRectMake(0, 5, 70, 20);
      UILabel* nameLabel = [[UILabel alloc] initWithFrame:nameLabelRect];
      nameLabel.textAlignment = NSTextAlignmentCenter;
      nameLabel.text = @"Name";
      nameLabel.font = [UIFont boldSystemFontOfSize:12];
      [cell.contentView addSubview: nameLabel];
  
      CGRect colorLabelRect = CGRectMake(0, 25, 70, 20);
      UILabel* colorLabel = [[UILabel alloc] initWithFrame:colorLabelRect];
      colorLabel.textAlignment = NSTextAlignmentCenter;
      colorLabel.text = @"Color";
      colorLabel.font = [UIFont boldSystemFontOfSize:12];
      [cell.contentView addSubview: colorLabel];
  
      CGRect priceLabelRect = CGRectMake(0, 45, 70, 20);
      UILabel *priceLabel = [[UILabel alloc] initWithFrame:priceLabelRect];
      priceLabel.text = @"Price";
      priceLabel.textAlignment = NSTextAlignmentCenter;
      colorLabel.font = [UIFont boldSystemFontOfSize:12];
      [cell.contentView addSubview:priceLabel];
  
      CGRect nameValueRect = CGRectMake(80, 5, 200, 20);
      UILabel* nameValue = [[UILabel alloc] initWithFrame: nameValueRect];
      nameValue.tag = kNameValueTag;
      [cell.contentView addSubview:nameValue];
  
      CGRect colorValueRect = CGRectMake(80, 25, 200, 20);
      UILabel* colorValue = [[UILabel alloc] initWithFrame:colorValueRect];
      colorValue.tag = kColorValueTag;
      [cell.contentView addSubview:colorValue];
  
      CGRect priceValueRect = CGRectMake(80, 45, 200, 20);
      UILabel *priceValue = [[UILabel alloc] initWithFrame:priceValueRect];
      priceValue.tag = kPriceValueTag;
      [cell.contentView addSubview:priceValue];
  }
  </code></pre>
  
  <p>and I would like to make that make that into a subclass, so I don't have to write all those lines, I just say cell = CustomCell and it does everything in the subclass.</p>