0

i seem to be having some difficulty trying to access a particular cell, i just need to change one of its objects when i select it in the tableview. There must be a way more efficient way than just calling reloadData all over again. Because thats the only way i could make a table cell look different, by rebuilding it when i select on one. Thanks for all the help :)

[self updatePreferences];
[tableView reloadData];

This is all i have atm on the method where it handles the interaction with table cells.

user1816481
  • 107
  • 1
  • 8
  • You can call tableView.reloadRowsAtIndexPaths See http://stackoverflow.com/questions/4448321/is-it-possible-to-refresh-a-single-uitableviewcell-in-a-uitableview – Will Jenkins Mar 14 '13 at 19:35

2 Answers2

0

Use the following code.To reload a single cell.

NSArray *array = [NSArray arrayWithObject:[NSIndexPath indexPathForRow:row inSection:section]]; 
[self.tableView reloadRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationNone];
kaar3k
  • 994
  • 7
  • 15
0

You could also make the cell a custom one and add a method to it like update or refresh.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
  CustomCell *cell = [tableView cellForRowAtIndexPath:indexPath];
  [cell refresh];
}
Jack Freeman
  • 1,414
  • 11
  • 18