DeShawnT
DeShawnT

Reputation: 479

Updating UITableViewCell not refreshing the UI

I have a UITableView and on the first time cellForRowAtIndexPath is called, I save all the UITableViewCell values I return. I do this so that I can update the contents when ever the underlying data changes.

However, when I update the contents of the UITableViewCell, the UITableView does not show the new entries until I scroll up and down on the UI. How do I programatically force the refresh?

Upvotes: 1

Views: 564

Answers (2)

Pierre
Pierre

Reputation: 11633

You can first save the index position of your cell, refresh your datas and then scroll automatically to your index.

So save it then call reloadData method and then scroll it to your save.

Upvotes: 1

ckruse
ckruse

Reputation: 9740

The UITableView has a method „reloadData.“ Just call it:

[tbl reloadData]

Upvotes: 1

Related Questions