У меня есть один массив для отображения значений в заголовке раздела табличного представления.Итак, для отображения этого массива значений в разделе я использовал – tableView:viewForHeaderInSection:
.Изначально все значения в массиве отображались правильно, но когда я прокручивал таблицу, значения этого раздела изменялись вместо исходных значений.пожалуйста, направьте меня, что там происходит.
я написал так в виде таблицы Заголовок Viewfor в разделе
UIView *headerView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 323, 50)];
//Background Image
///UIImageView *headerBg=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"arrow-button_50.png"]];
/// [headerView addSubview:headerBg];
//Button
UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
button.frame=CGRectMake(0, 0, 215, 70);
button.tag=section+1;
[button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
[button setImage:[UIImage imageNamed:@"down_arrow.png"] forState:UIControlStateNormal];
[button setImage:[UIImage imageNamed:@"right_arrow.png"] forState:UIControlStateSelected];
if([[self.cellcountarray objectAtIndex:section] intValue]==0)
button.selected=YES;
else button.selected=NO;
[headerView addSubview:button];
NearbyPeople *obj=[self.sectionArray objectAtIndex:section];
NSLog(@"first name from section %@",[self.sectionArray objectAtIndex:0]);
UILabel *headerTitle=[[UILabel alloc]initWithFrame:CGRectMake(30, 15, 300, 30)];
[headerTitle setBackgroundColor:[UIColor clearColor]];
[headerTitle setFont:[UIFont fontWithName:@"Helvetica-Bold" size:15]];
[headerTitle setTextColor:[UIColor whiteColor]];
headerTitle.text=[NSString stringWithFormat:@" %@",obj.FirstName];
NSLog(@"header text is %@",headerTitle.text);
///[headerTitle setText:obj.FirstName];
[headerView addSubview:headerTitle];
[headerTitle release];
Заранее благодарен