Rozszerzanie i zwijanie komórek widoku tabeli w ios

Mam widok tabeli niestandardowych komórek i niektórych przycisków w każdej komórce. Kliknięcie dowolnego przycisku wewnątrz komórki spowoduje wyświetlenie kolejnego niestandardowego widoku poniżej tej komórki. Następne kliknięcie tego samego przycisku spowoduje zwinięcie widoku i będzie tego samego potrzebne dla wszystkich komórek Próbowałem za pomocą metody inserttrow na kliknięcie przycisku, ale na próżno. Jak mogę to zrobić przy użyciu tylko delegatów widoku tabeli.

To właśnie próbowałem:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *simpleTableIdentifier = @"CustomCell_For_Dashboard";

    CustomCellFor_Dashboard  *customCell = (CustomCellFor_Dashboard *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
    if (customCell == nil)
    {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCellFor_Dashboard" owner:self options:nil];
        customCell = [nib objectAtIndex:0];
    }
    [customCell.howyoulfeelBtn  addTarget:self action:@selector(buttonclicked:) forControlEvents:UIControlEventTouchUpInside];
      customCell.nameLabel.text = @"test";
    customCell.imgView.image = [UIImage imageNamed:@"Default.png"];
   // customCell.prepTimeLabel.text = [prepTime objectAtIndex:indexPath.row];
    return customCell;
}

-(void)buttonclicked:(id)sender{
    NSIndexPath *indexPath = [myTable indexPathForCell:sender];


    [myTable beginUpdates];

     NSIndexPath *insertPath = [NSIndexPath indexPathForRow:indexPath.row inSection:indexPath.section];
   [myTable insertRowsAtIndexPaths:[NSArray arrayWithObject:insertPath] withRowAnimation:UITableViewRowAnimationTop];
  } 

czy ktoś może mi pomóc?

questionAnswers(4)

yourAnswerToTheQuestion