0
请问谁能帮我解决这个问题?删除行后添加文字
我有一个名为favorite的选项,每当我选择我最喜欢的歌曲时,歌曲将被添加到最喜欢的选项里面。所以我为它制作了一张桌子,每个单元格会存储我选择的每首歌曲。我也可以删除歌曲。但在我选择任何歌曲之前,我希望它能显示一些通知文本。或者当我完全删除该收藏夹中的所有内容时,我希望显示相同的文本,并且每次添加任何内容时都必须消失。任何人都可以给我一个想法如何做到这一点?
// DELETE FAVORITE
-(void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
}
- (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];
}
}
这是我的代码,用于删除该表内的行。