Adding dynamic sub-rows by selecting tableview row in tableview iPhone errors?

后端 未结 2 1320
一生所求
一生所求 2021-01-25 15:12

I want to add row dynamically. I have tableview list of building names. If some one choose building(didSelectRowAtIndexPath) then respective floors of building should get added

2条回答
  •  没有蜡笔的小新
    2021-01-25 15:56

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath   *)indexPath 
    {
        //NSIndexPath *selectedIndexPath = [self.indoortable indexPathForSelectedRow];
    zonesFloorA = [[NSArray alloc] initWithObjects:@"Gr fl",@"1st fl",@"2nd fl",nil];
    
    if (tableView == indoortable )
    {
        for (NSString *str in zonesFloorA) {
            [indoorZones addObject:str];
       }
       //[[self indoortable] beginUpdates];
       //[[self indoortable] insertRowsAtIndexPaths:(NSArray *)zonesFloor  withRowAnimation:UITableViewRowAnimationNone];
       //[[self indoortable] endUpdates];
    }
    if (tableView == indoortable_iPad )
    {
    
    //some logic
     }
    
      [tableView reloadData];
    
    }
    

    may this meet your requirement

提交回复
热议问题