I have an app that query data from a class in Parse.com.
I'm able to populate the table correctly.
How can i add a Pull to Refresh to refresh the tableview ?
Thanks!
reloadData
when it is done. endRefreshing
.EDIT - most of the time, the view controller containing the table is also the table's datasource. If that's the case, then create the refresh control in that same view controller's viewDidLoad
method.
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self
action:@selector(refresh:)
forControlEvents:UIControlEventValueChanged];
Set the target to self
and in that same class implement the selector refresh, which will have a signature like this:
- (void)refresh:(UIRefreshControl *)control {
// step two: from here, invoke the same parse query code you have working
}