異なるセル識別子を持つカスタム UITableView を作成しようとしています。最初のセルには画像が表示され、残りのセルに続くように下に表示されます。ただし、スクロール後に表示された画像が消えます。同様の問題について他の人が提供した回答を探して解決しようとしましたが、成功しませんでした。
これがコードです。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
EventoCell *cell;
static NSMutableString *CellIdentifier;
if(i==0){
CellIdentifier = @"imgCell";
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
i++;
}
else{
CellIdentifier = @"CellaEvento";
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.Nome.text=[[AShow objectAtIndex:indexPath.row]GetEvento];
cell.Localita.text=[[AShow objectAtIndex:indexPath.row]GetLocalita];
cell.Ora.text=[NSString stringWithFormat:@"%d:%d",[[AShow objectAtIndex:indexPath.row]GetOra],[[AShow objectAtIndex:indexPath.row]GetMinuti]];
[cell setValue:[[AShow objectAtIndex:indexPath.row]GetEvento] :[[AShow objectAtIndex:indexPath.row]GetGiorno] :[[AShow objectAtIndex:indexPath.row]GetMese] :[[AShow objectAtIndex:indexPath.row]GetAnno] :[[AShow objectAtIndex:indexPath.row]GetOra] :[[AShow objectAtIndex:indexPath.row]GetMinuti]];
}
return cell;
}