tags:

views:

36

answers:

1

Hi,

I am retrieving the Json data from an URL into a table view. The problem is that i couldnt replace the old data that is retrieved, with the new data when i click another table cell. The new data is getting added to the last cell of the table cell while the old data is also getting displayed. What could be the problem...

A: 

You have to replace the data for the current cell with the new data then call the reloadData method on your tableview.

I mean you need to change the data in the array / datastore you pull from when rendering your cells in your delegate methods.

By replacing the code when the table view requests all the data & cells for rendering your delegate methods will pull the new data down and return an updated cell.

Matt S
It would be great if i could get some sample code of how to implement the reloadData method.
sudhakar
In my controller class that extends UITableViewController I have `[self.tableView reloadData];` after I've updated my data. `reloadData` is provided by UITableView. See http://developer.apple.com/iphone/library/documentation/uikit/reference/UITableView_Class/Reference/Reference.html#//apple_ref/occ/instm/UITableView/reloadData for more information
Matt S
it would be great if i could get implement of the reloadData,but same problem..
sudhakar