title: How to fix: initWithFrame:CellFrame reuseIdentifier:cellIdentifier deprecated
body: <p>I upgraded to XCODE 4.2 and suddenly i got all these warning signals. Most of the i am able to fix but the following I do not know how to. I have tried to read-up on it but still have problem.</p>
  
  <p>The code that is deprecated is:</p>
  
  <pre><code>UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CellFrame reuseIdentifier:cellIdentifier] autorelease];
  </code></pre>
  
  <p>I know that i need to use the following:</p>
  
  <pre><code>- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  </code></pre>
  
  <p>However, i get problem with the CellFrame etc. when i test.</p>
  
  <p>Could someone please give me a hint how i should replace the deprecated code with the initWithStyle and get the same result?</p>
  
  <p>Here is the full code:</p>
  
  <pre><code>- (UITableViewCell *) getCellContentView:(NSString *)cellIdentifier {
  
  CGRect CellFrame = CGRectMake(0, 0, 300, 60);
  CGRect Label1Frame = CGRectMake(10, 10, 290, 25);
  CGRect Label2Frame = CGRectMake(30, 33, 270, 25);
  CGRect Label3Frame = CGRectMake(30, 56, 270, 25);
  UILabel *lblTemp;
  
  UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CellFrame reuseIdentifier:cellIdentifier] autorelease];
  
  //Initialize Label with tag 1.
  lblTemp = [[UILabel alloc] initWithFrame:Label1Frame];
  lblTemp.backgroundColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.3f alpha:1.0f];
  lblTemp.textColor = [UIColor whiteColor];
  lblTemp.backgroundColor = [UIColor clearColor];
  [lblTemp setFont:[UIFont fontWithName:@"American Typewriter" size:16]];
  lblTemp.tag = 1;
  [cell.contentView addSubview:lblTemp];
  [lblTemp release];
  
  //Initialize Label with tag 2.
  lblTemp = [[UILabel alloc] initWithFrame:Label2Frame];
  lblTemp.backgroundColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.3f alpha:1.0f];
  lblTemp.tag = 2;
  [lblTemp setFont:[UIFont fontWithName:@"American Typewriter" size:13]];
  lblTemp.textColor = [UIColor whiteColor];
  lblTemp.backgroundColor = [UIColor clearColor];
  [cell.contentView addSubview:lblTemp];
  [lblTemp release];
  
  //Initialize Label with tag 3.
  lblTemp = [[UILabel alloc] initWithFrame:Label3Frame];
  lblTemp.backgroundColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.3f alpha:1.0f];
  lblTemp.tag = 3;
  [lblTemp setFont:[UIFont fontWithName:@"American Typewriter" size:13]];
  lblTemp.textColor = [UIColor whiteColor];
  lblTemp.backgroundColor = [UIColor clearColor];
  [cell.contentView addSubview:lblTemp];
  [lblTemp release];
  
  return cell;
  }
  </code></pre>