2012-05-12 11 views

Respuesta

53

Puede llamar al [self.tableview reloadData]; en la vista de tabla y actualizar toda la tabla.

De lo contrario, puede hacer esto para actualizar una sola celda.

[self.tableView beginUpdates]; 
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPathOfYourCell] withRowAnimation:UITableViewRowAnimationNone]; 
[self.tableView endUpdates]; 
+0

Probé [self.tableview reloadData] excepto que no parece recordar el método "- (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath "y agrega la imagen a las nuevas celdas. – user1120008

+0

Lo hace. Entonces tiene un error en su código en otro lugar. –

+2

Ponga un NSLog (@ "Método llamado"); en su '- (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath' si desea probarlo usted mismo. –

3

Como usted ya tiene indexPath de la célula, a veces esto sólo puede hacer el trabajo

UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; 
[cell reloadInputViews]; 
+1

Si solo está utilizando UITableViewCell y no es una clase personalizada no debería haber necesidad de convertir el puntero UITableViewCell en un puntero UITableViewCell – jcpennypincher

+0

@jcpennypincher gracias por señalarlo – user1139921

Cuestiones relacionadas