I have a custom separator in every cell(added it in the IB), I want to delete/hide it based on a specific condition:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier= @"satellite";
SatellitesCell *cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(!cell) {
cell =[[SatellitesCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
if([[arrayofRadios objectAtIndex:indexPath.row] isEqualToString:@""]){
[cell.separatorImage removeFromSuperview];
cell.separatorImage = nil;
}
cell.satelliteName.text=[arrayofSatellitesName objectAtIndex:indexPath.row];
return cell;
}
When launching the view, all is okay, but the problem is when scrolling, the separator(the UIImageView) is displaying randomly in every cell.