Here what you can do with iOS 6 and later:
- (void)viewDidLoad {
// other initialization
self.refreshControl = [[UIRefreshControl alloc] init];
[self.refreshControl addTarget:self
action:@selector(myRefresh)
forControlEvents:UIControlEventValueChanged];
}
Your refresh method:
- (void)myRefresh {
// get refreshed data for table view
}
You end refreshing in reloadData:
- (void)reloadData {
[self.tableView reloadData];
// End the refreshing
if (self.refreshControl) {
[self.refreshControl endRefreshing];
}
}
Then you are all set!