If you have more than one section, assuming self
is the view controller that contains tableView
and conforms to the UITableViewDataSource
protocol:
NSUInteger _lastSection = [self numberOfSectionsInTableView:tableView];
NSUInteger _lastRow = [tableView numberOfRowsInSection:_lastSection] - 1;
NSUInteger _path[2] = {_lastSection, _lastRow};
NSIndexPath *_indexPath = [[NSIndexPath alloc] initWithIndexes:_path length:2];
NSArray *_indexPaths = [[NSArray alloc] initWithObjects:_indexPath, nil];
[_indexPath release];
[tableView beginUpdates];
[tableView deleteRowsAtIndexPaths:_indexPaths withRowAnimation:UITableViewRowAnimationNone];
[tableView endUpdates];
[_indexPaths release];