Is it possible to update only the Text label in a Tableview without using reloaddata to reset it all?
Asked
Active
Viewed 30 times
1
-
No. Its not possible without reloading – S1LENT WARRIOR Aug 29 '15 at 18:13
-
Do you want to update only one specific cell's text label or all cells, or somewhere else? – ajay_nasa Aug 29 '15 at 18:14
-
Yes. Just the cell.textlabel.text I need to update it every 30 seconds. – user2868511 Aug 29 '15 at 18:41
-
You can store references to the labels of the visible cells in a separate array and update their text property according your needs. – RTasche Aug 29 '15 at 19:49
-
@hacker2007 - That will work until the user scrolls a cell offscreen. – par Aug 29 '15 at 20:06
-
1See https://stackoverflow.com/questions/4448321/is-it-possible-to-refresh-a-single-uitableviewcell-in-a-uitableview – par Aug 29 '15 at 20:07
-
Isn't that enough? If one row moves offscreen another row moves on screen. For the new row tableView:cellForRowAtIndexPath: provides a new cell with the updated text provided by your datasource. You can add this label to your array and remove the one you don't need anymore in tableView:didEndDisplayingCell:forRowAtIndexPath:. – RTasche Aug 30 '15 at 08:31
-
Very helpful. Thanks – user2868511 Sep 02 '15 at 04:37