开发者

iphone reload table data

I am trying to update a list in a tableview controller. In viewWillAppear in that particular tableview controller, the tableView is setup with the code:

[self.tableView reloadData];

I am trying to do this refresh from an other Class (DetailViewController), which refers to another view controller. In a method in DetailViewController I want to reload the data in JobsViewController, but can't do it. I can envision the below co开发者_C百科de working, but something is still missing. Can anyone please shed some light on this?

[JobsViewController.tableView reloadData];


Did you also change your data source? reloadData does only reload the cells. It doesn't take care of actually updating the underlying datasource. E.g. if you read data from an array in tableView:cellForRowAtIndexPath:, your have to change the array values befor calling reloadData.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜