I added UIRefreshControl functionality in my project that uses a UITableView. The application works by retrieving records from a web service in a table format. The following is the code I used to add the UIRefreshControl:
- (void)viewDidLoad { [super viewDidLoad]; UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; refreshControl.tintColor = [UIColor grayColor]; refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Updating New Entries"]; [refreshControl addTarget:self action:@selector(pullToRefresh) forControlEvents:UIControlEventValueChanged]; self.refreshControl = refreshControl; [self pullToRefresh]; } - (void) pullToRefresh { counter = 1; [self fetchEntriesNew:counter];
Now, if I try to update, it updates, adding new entries, if any, and shows me the following view on top of the table:

Everything works fine, except when the application is launched or opened for the first time, it does not display the view that I showed in the above image, although it updates the table view. I want it to display an update management view every time it updates it. Can someone point out what I'm doing wrong? Thanks!
UPDATE: I added [self refreshControl beginRefreshing], and now the Spinner UIRefreshControl view is displayed, but it is higher than the first record in the table. Can someone point out how to fix it?
Aj112 source share