Xcode TableViewCell Hide/Unhide multiple cells when clicking on one cell with objective C

I have a tableView that has 8 cells. When you click cell 2 I want to hide/unhide cells 3-5.But I don’t know how to send those cell number to the height or am I messing. I also need to know how to refresh the menu after the height is change. Thanks in advance.

  • (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];

    if([indexPath row] == 1){
    ”;//

    }else if([indexPath row] == 2){

     if( viewCells ==0){
         viewCells =1;
         //  What needs to be here to change the 3-5 index height
     }else{
         viewCells =0;
         //  What needs to be here to change the 3-5 index height
     }
    

    }else if([indexPath row] == 3){

    //
    

    }else if([indexPath row] == 4){

    //
    

    }else if([indexPath row] == 5){

    //
    

    }else if([indexPath row] == 6){

    //
    

    }else if([indexPath row] == 7){

    //
    

    }else if([indexPath row] == 8){
    //
    }
    }

  • (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {

    if(viewCells==0){

    return 44;
    

    }else{

    return 0;
    

    }
    return 44;
    }