滚动不堆积时如何在tableViewCell中创建数据?
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *theCell = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:theCell];
if (! cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:theCell];
}
UILabel *data1 = [self createLabelText:[NSString stringWithFormat:@"%@",[[arrayUtama objectAtIndex:indexPath.row]objectForKey:@"nomer"]]WithFrame:CGRectMake(10, 10, 150, 50) WithFont:[UIFont fontWithName:@"Arial" size:16] WithColor:[UIColor clearColor]];
[cell insertSubview:data1 atIndex:0];
UILabel *data2 = [self createLabelText:[NSString stringWithFormat:@"%@",[[arrayUtama objectAtIndex:indexPath.row]objectForKey:@"subjek"]]WithFrame:CGRectMake(50, 10, 150, 50) WithFont:[UIFont fontWithName:@"Arial" size:16] WithColor:[UIColor clearColor]];
[cell insertSubview:data2 atIndex:1];
UILabel *data3 = [self createLabelText:[NSString stringWithFormat:@"%@",[[arrayUtama objectAtIndex:indexPath.row]objectForKey:@"shadowScore"]]WithFrame:CGRectMake(200, 10, 150, 50) WithFont:[UIFont fontWithName:@"Arial" size:16] WithColor:[UIColor clearColor]];
[cell insertSubview:data3 atIndex:2];
UILabel *data4 = [self createLabelText:[NSString stringWithFormat:@"%@",[[arrayUtama objectAtIndex:indexPath.row]objectForKey:@"finalScore"]]WithFrame:CGRectMake(250, 10, 150, 50) WithFont:[UIFont fontWithName:@"Arial" size:16] WithColor:[UIColor clearColor]];
[cell insertSubview:data4 atIndex:3];
UILabel *data5 = [self createLabelText:[NSString stringWithFormat:@"%@",[[arrayUtama objectAtIndex:indexPath.row]objectForKey:@"kkm"]]WithFrame:CGRectMake(300, 10, 150, 50) WithFont:[UIFont fontWithName:@"Arial" size:16] WithColor:[UIColor clearColor]];
[cell insertSubview:data5 atIndex:4];
UILabel *data6 = [self createLabelText:[NSString stringWithFormat:@"%@",[[arrayUtama objectAtIndex:indexPath.row]objectForKey:@"Status"]]WithFrame:CGRectMake(350, 10, 150, 50) WithFont:[UIFont fontWithName:@"Arial" size:16] WithColor:[UIColor clearColor]];
[cell insertSubview:data6 atIndex:5];
UILabel *data7 = [self createLabelText:[NSString stringWithFormat:@"%@",[[arrayUtama objectAtIndex:indexPath.row]objectForKey:@"teachernote"]]WithFrame:CGRectMake(400, 10, 150, 50) WithFont:[UIFont fontWithName:@"Arial" size:16] WithColor:[UIColor clearColor]];
[cell insertSubview:data7 atIndex:6];
return cell;
}