Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rebello95

macrumors member
Original poster
Jun 15, 2011
40
0
USA
Okay so I'm making an app that forwards to one of my websites. I'm trying to figure out how to make the Pull to Refresh have the webpage reload. I followed the instructions on https://github.com/leah/PullToRefresh and got to the last step, but I don't know what programming to put in the subclass. Can someone please help me? Thanks
 
Err, so what is your question exactly?

It's calling a selector here -->
Code:
 - (void)refresh {
    [self performSelector:@selector(addItem) withObject:nil afterDelay:2.0];
}
which is calling this methid -->

Code:
- (void)addItem {
    // Add a new time
    NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
    [dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
    NSString *now = [dateFormatter stringFromDate:[NSDate date]];
    [items insertObject:[NSString stringWithFormat:@"%@", now] atIndex:0];

    [self.tableView reloadData];

    [self stopLoading];
}

So just change the code in there, play around with it, hint, there are some build in codes for webviews to reload!
 
Well the thing is, I'm a new developer... I know which code to change but not what to change that code to. Does anyone know the code I need to make it refresh a webpage?
Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.