How to Refresh a list view in background?
I want to refresh a list view in a controller while it is in backgroun开发者_运维技巧d. As i want to update the array of that list.
any ideas on how to do this.
Thnx a lot in advance
I think what you meant was that your ViewController was pushed back in the stack and from the top View controller you want to update the array and reload list? If this assumption is correct this is what you can do
- Define the array [containing data for list] as property and synthesize it for accessing outside
- Define the list UITableView as property (synthesize) as well to access it in subclass.
- Store the reference of this controller in the child controller for access
- Update the array using the stored reference
- Reload the tableView via [self.parentController.tableView reloadData];
Read about NSOperation and NSOperationQueue. NSThread also might be useful.
Both will give you ideas how to do some work in background.
精彩评论