program developer descargar apple iphone ipad iphone-sdk-3.0 ios4 ios-simulator

iphone - developer - xcode



tablerow delete pero todavĂ­a aparece en la vista de tabla (2)

Hay un pequeño error (o creo que el código relevante no se muestra). Ha borrado la entrada de la base de datos, pero creo que no la eliminó de su matriz, que actúa como fuente de datos de tabla vista.

-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { [self.table beginUpdates]; if (editingStyle == UITableViewCellEditingStyleDelete) { // [self.table deleteRowsAtIndexPaths:[NSArray arrayWithObject: indexPath] withRowAnimation:UITableViewRowAnimationFade]; Hadits *delHadit = [self.allBookMarks objectAtIndex:indexPath.row]; dbAccess *dbmethods = [[dbAccess alloc] init]; NSInteger delHaditid = delHadit.haditid; [dbmethods deleteBookMark:delHaditid]; [dbmethods release]; [self.allBookMarks removeObject:delHadit];/// change of code } //[self.table reloadData]; [table endUpdates]; }

mis datos se muestran en la tabla donde selecciono datos para deletrear su delted desde la base de datos pero no desde la tabla, vuelvo a otra vista y vuelvo a la vista de eliminar tabla y luego borrar datos no se muestran nuevamente. Estoy usando este código. . - (void) deleteRowsAtIndexPaths: (NSArray *) indexPath withRowAnimation: animación (UITableViewRowAnimation) {

NSLog(@"Hello");

}

- (void) tableView: (UITableView *) tableView commitEditingStyle: (UITableViewCellEditingStyle) editingStyle forRowAtIndexPath: (NSIndexPath *) indexPath

{// int row = [indexPath fila]; [self.table beginUpdates]; if (editingStyle == UITableViewCellEditingStyleDelete) {
Hadits * delHadit = [self.allBookMarks objectAtIndex: indexPath.row]; dbAccess * dbmethods = [[dbAccess alloc] init]; NSInteger delHaditid = delHadit.haditid; [dbmethods deleteBookMark: delHaditid]; [dbmethods release]; }

[self deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; [self.table endUpdates]; NSLog(@"Hello"); [self.table reloadData];

}

... Necesito ayuda ... Recuerdos Haseeb


a la vista aparecerá preparar su matriz que teniendo record y en commitEditing agregará una línea.

[self viewWillApear:YES];

y en viewWillAppear agregue esta línea

[yourTable reloadData];

después de obtener datos de db.