Hallo zusammen,
ich möchte in Abhängigkeit des Vorhandenseins eines Dict-Eintrages einen eigenen Disclosure indicator anzeigen. Wenn Der Eintrag vorhanden ist, soll das Bild angezeigt werden, ansonsten nicht.
Alles anzeigen
Allerdings wird mir das Bild nach dem Scrollen nach unten und wieder nach oben immer öfter angezeigt und auch bei Einträgen, die keinen "Anhang" haben, also bei denen Kein Eintrag im Dict vorhanden ist.
Was passiert da?
LG
Bernd
ich möchte in Abhängigkeit des Vorhandenseins eines Dict-Eintrages einen eigenen Disclosure indicator anzeigen. Wenn Der Eintrag vorhanden ist, soll das Bild angezeigt werden, ansonsten nicht.
Quellcode
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ListeCell"];
- daten_dic = [self.listeGefiltert_arr objectAtIndex:indexPath.row];
- cell.textLabel.text = [daten_dic objectForKey:@"titel"];
- cell.detailTextLabel.text = [daten_dic objectForKey:@"inhalt"];
- cell.textLabel.textColor = [UIColor colorWithWhite:1.0 alpha:1.0];
- cell.textLabel.backgroundColor = [UIColor clearColor];
- cell.detailTextLabel.textColor = [UIColor colorWithWhite:1.0 alpha:1.0];
- cell.detailTextLabel.backgroundColor = [UIColor clearColor];
- cell.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1];
- cell.selectionStyle = UITableViewCellSelectionStyleDefault;
- if (![[daten_dic objectForKey:@"bild"] isEqualToString:@""]) {
- cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"anhang.png"]];
- }
- UIView *selectedView = [[UIView alloc]init];
- selectedView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];
- cell.selectedBackgroundView = selectedView;
- return cell;
- }
Allerdings wird mir das Bild nach dem Scrollen nach unten und wieder nach oben immer öfter angezeigt und auch bei Einträgen, die keinen "Anhang" haben, also bei denen Kein Eintrag im Dict vorhanden ist.
Was passiert da?
LG
Bernd
Ich bin gegen Signaturen!!!