我有UITableViewController。在<code>cellForRowAtIndexPath</code>方法中,我为标签添加了自定义设置:
UILabel *lblMainLabel = [[UILabel alloc]initWithFrame:CGRectMake(50, 9, 150, 25)];
lblMainLabel.text = c.Name;
lblMainLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];
lblMainLabel.backgroundColor = [UIColor clearColor];
lblMainLabel.textColor = [UIColor whiteColor];
[cell.contentView addSubview:lblMainLabel];
[lblMainLabel release];
但当我在表格中向上或向下滚动时,它总是在之前的标签上添加这个标签,我错过了什么?