views:

361

answers:

1

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 code working, but something is still missing. Can anyone please shed some light on this?

[JobsViewController.tableView reloadData];

+1  A: 

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.

Daniel Hepper
yeah i guess thats the problem, I can reload that View Manually, and it doesn't do what I want anyway. Cheers for the tip.
norskben
Is there a way to reload the array or data source?
Warrior