How is it possible to delete all rows from UITableView at once?
Because when I reload table view with new data, I am still inserting new rows:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
CustomTableViewCell *cell = (CustomTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[CustomTableViewCell alloc] initWithFrame:CGRectZero] autorelease];
}
//... setting the new cell here ...
return cell;
}
Thank you.
Do this.
Before you are reloading the table with
Remove all objects from your tableView array (The array which populated your tableView)
For example.