[Solved] Delete all rows in a tableview [duplicate]


On the button action event remove all the objects from itemArray then reload tableView data. Before this make sure that in tableView delegate numberOfRowInsection you are passing itemArray count like that:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{
    return [itemArray count];
}

// button action//

-(IBAction)deleteTableViewData
{
     [itemArray removeAllObjects];
     [tableView reloadData];
}

3

solved Delete all rows in a tableview [duplicate]