J'ai 3 tables appelées radio, chanson et artiste contrôlées par mes favoris. Maintenant, je veux afficher un texte différent pour chaque table quand il n'y a rien à l'intérieur de la table. Mais je veux que le texte soit enlevé quand il y a quelque chose à l'intérieur de la table. Je pourrais afficher le texte, en y ajoutant une étiquette.Comment cacher et montrer l'étiquette à l'intérieur d'une table?
if ([mainDataCenter.favoriteArtistArray count] == 0)
{
[label setTextColor:[UIColor whiteColor]];
[label setText:@"AUCUN FAVORI DE FICHE ARTISTE"];
}
else
{
[label setHidden:YES];
}
mais après le texte est caché dans une table (ce qui signifie qu'il ya quelque chose ajouté qu'à cette table particulière), mais les autres textes dans d'autres tableaux a également disparu.
- (void)tableView:(UITableView*)tv commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath*)indexPath
{
// If row is deleted, remove it from the list.
if (UITableViewCellEditingStyleDelete == editingStyle)
{
WebRadio *aRadio = [mainDataCenter.favoriteWebRadioArray objectAtIndex:indexPath.row];
[mainDataCenter removeWebRadioFromFavorite:aRadio];
// Animate the deletion from the table.
[tv deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
Ceci est le code où je supprime les choses pour la table webradio. (les 3 autres tables sont également les mêmes) J'apprécie si quelqu'un pouvait m'aider dans ce problème que j'ai eu.