Hi Guys, I'm having a weird issue with my UITableView. The cells are configured from an Array of my Contract model. Adding and deleting instances work well. When I add a new Contract after previously deleting one, the old cell and the new cell's content are merged on the new one. Here's a picture: http://cl.ly/1WZy/ (Can't post images, just two reputation points shy.)
My app has basic data persitence, reading and writing my custom Contract model from a file. My cells are customized by adding subviews to the contentView
.
Here's my tableView:cellForRow:AtIndexPath
method:
// Configure the cell...
// The Contract We're Dealing With
JWContract *c = [self.contracts objectAtIndex:indexPath.row];
NSLog(@"%d", indexPath.row);
// The Title Label
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(220, -26, 340, 120)];
UIFont *f = [UIFont fontWithName:@"HelveticaNeue-Bold" size:35];
titleLabel.font = f;
titleLabel.text = c.title;
titleLabel.backgroundColor = [UIColor clearColor];
[cell.contentView addSubview:titleLabel];
// The Customer Name Label
UILabel *customerNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(220, 25, 340, 120 )];
UIFont *a = [UIFont fontWithName:@"HelveticaNeue" size:30];
customerNameLabel.font = a;
customerNameLabel.textColor = [UIColor colorWithRed:0.204106 green:0.211957 blue:0.211957 alpha:1.0000];
customerNameLabel.text = c.customerName;
customerNameLabel.backgroundColor = [UIColor clearColor];
[cell.contentView addSubview:customerNameLabel];
Any ideas? Thanks.