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 UITable开发者_如何学PythonViewCell, the UITableView does not show the new entries until I scroll up and down on the UI. How do I programatically force the refresh?
The UITableView has a method „reloadData.“ Just call it:
[tbl reloadData]
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.
精彩评论