Hassan Zaheer Hassan Zaheer - 5 months ago 45
iOS Question

Pull to refresh on UITableView Inside a UIViewController

I am trying to implement the pull to refresh functionality in my application. The architecture is such that the there is a

inside a
. I want to be able to refresh the tableview on pull down. I tried the code below in the
method, but it does not work. Can any one tell me where am I wrong in implementation?

UIRefreshControl *refresh = [[UIRefreshControl alloc] init];
refresh.tintColor = [UIColor grayColor];
refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];
[refresh addTarget:self action:@selector(get_vrns) forControlEvents:UIControlEventValueChanged];
[self.vrnTable addSubview:refresh];


UIRefreshControl without UITableViewController

Or you can use UITableViewController instead of a UIViewController.