see below code, it removes object from array but it not reloading table
- (void)tableView:(UITableView *)aTableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@" commitEditingStyle");
if (editingStyle == UITableViewCellEditingStyleDelete)
{
NSLog(@" commitEditingStyle Delete ");
[self.arry removeObjectAtIndex:indexPath.row];
[tableView reloadData];
} else if (editingStyle == UITableViewCellEditingStyleInsert)
{
NSLog(@" commitEditingStyle Insert ");
[self.arry insertObject:@"New Row" atIndex:[arry count]];
[tableView reloadData];
}
}
also i have [tableView reloadData] written in ViewWillAppear & ViewDidLoad but it not reloading.
TableView is added tothe ViewController through the storyboard & IBoutlet is added to .h file
You must either send your message to your outlet (if you have one i.e.
self.tableView) or directly to the tableview that called the delegate method:[aTableView reloadData];(notice the a).If you take a closer look at the method signature, you’ll see that the tableView instance is passed to you as
aTableView:-(void)tableView:(UITableView *)aTableView…