I know this type of questions has been asked here on SO before and I’ve tried almost all of them but to no avail. I’m trying to delete a row from a UITableView. Here is my code.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
//calls to a method that deletes the row from the backend SQLite database
[self deleteCompany:indexPath.row];
//theCompanies is a NSMutableArray. When the app starts, it retrieves the data and display it in the UITableView
[theCompanies removeObjectAtIndex:indexPath.row];
//Below line is where the error occurs.
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:YES
UITableViewRowAnimationFade:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
}
}
I get the following complier error when I build the app.
No visible @interface for ‘UITableView’ declares the selector…
I hav no clue what I should do next. Any help would be appreciated.
Thank you.
The method is like this
With two argument see here Apple UITableView Document
But you have used like is is of three argument and withRowAnimation as BOOL but it is not BOOL.
Try something like this: