Aleph72
Aleph72

Reputation: 887

ios 6 pull to refresh

I've implemented the new pull to refresh method in my app, adding the following code to viewDidLoad:

UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged];
[self.tableView addSubview:refreshControl];

The method handleRefresh loads some data from a DB and then refreshes the tableview. This method only get called when the user is pulling the tableview. Now I'd like to manually call the handleRefresh method because at some point I'm deleting some items from the DB and I need to load data again, before reloading the tableview. How to do it?

Upvotes: 3

Views: 1893

Answers (1)

Geraud.ch
Geraud.ch

Reputation: 1499

Something like [self handleRefresh:nil]

Upvotes: 2

Related Questions