
Untitled
By: a guest on
May 8th, 2012 | syntax:
None | size: 0.85 KB | hits: 16 | expires: Never
UITableView NSFetchedResultsController philosophy
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[myContext deleteObject:[fetchedResultsController objectAtIndexPath:indexPath]];
if (![myContext save:&error]) {
// Error handling
}
fetchedResultsController = nil;
if (![[self getFetchedResultController] performFetch:&error]) {
// Error handling
}
[tableView reloadData];
}
}
fetchedResultsController = nil;
if (![[self getFetchedResultController] performFetch:&error]) {
// Error handling
}
[tableView reloadData];