lundi 9 février 2015

Record coming back after navigation (sqlite) xcode 6

Recently faced a problem which is unable to delete records from sqlite db. Im able to delete from tableview but when i navigate to another page and navigate back the records is back. how do i delete from the db. My tableview is using swipe to delete. appreciate help



- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{




[self.entries removeObjectAtIndex:indexPath.row];
// Delete the row from the data source
[tableView beginUpdates];
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];

[tableView endUpdates];
[tableView reloadData];




}
}

Aucun commentaire:

Enregistrer un commentaire