I tried your code it could not work. I tried mine it worked but there still bugs. the text will not be wiped out according to my desire.
if (sender == songMenuButton)
{
[mainAppDelegate xitiWithS2:7 p:@"Favoris_Liste_Titres"];
[artistBackButton setHidden:YES];
[songBackButton setHidden:(0==songBackButtonToClick)];
selectedMenuIndex = 2;
if ( [mainDataCenter.favoriteSongArray count] == 0)
{
[label setHidden:YES];
}
else
{
[label setTextColor:[UIColor whiteColor]];
[label setText:@"AUCUN FAVORI TITRE"];
//@"AUCUN FAVORI TITRE"];
}
}
this is for one button
I have total 3 buttons in the favorite menu
after i click other button and click back again, the text disappear but also disappear on other buttons too even though nothing in there,( it is supposed to print the text when there is nothing).
- (void)tableView:(UITableView*)tv commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath*)indexPath
{
// If row is deleted, remove it from the list.
if (UITableViewCellEditingStyleDelete == editingStyle)
{
Metadata *aData = [mainDataCenter.favoriteSongArray objectAtIndex:indexPath.row];
[mainDataCenter removeSongFromFavorite:aData];
// Animate the deletion from the table.
[tv deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
This is how i remove the items