Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jchildress

macrumors member
Original poster
Jul 9, 2008
49
0
I have a tableview with custom cells that I would like to update whenever I need too. For example, each cell has an extra UILabel on the right side of the cell that contains a value of a setting. When you tap that cell, it loads up a new view where you can change the value of that setting. When the modified setting is save by pressing the save button on this new view, and the navigation controller takes you back to the original (top) view, I want the original tableView to update the cell with the newly modified value.

I think becuase the tableView code tries to save the cells to prevent them from being recreated, saving time and memory I assume, I think this is causing the cell to never update. Is there a method I can call to tell all cells or specific cells to update their Text\UILabels with the newly updated value?
 

Luke Redpath

macrumors 6502a
Nov 9, 2007
733
6
Colchester, UK
You should be setting the contents for your cell each time tableView:cellForRowAtIndexPath: is called. If you update the source of your cell data then it should be updated automatically. What does your method look like?
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
[UITableView reloadData] should cause everything to redraw. I assume you are setting the new value in your model object. The cells will be rebuilt with the new values.

Look at the CustomTableViewCell sample in the TableView Suite examples.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.