Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)viewDidLoad {
- //code to add PullToRefresh to the view
- refreshHeaderView = [[PullToRefreshView alloc] initWithScrollView:(UIScrollView *) self.TableView];
- [refreshHeaderView setDelegate:self];
- [self.TableView addSubview:refreshHeaderView];
- }
- //PullToRefresh methods
- - (void)reloadTableData
- {
- NSString* WMATA_URL = [NSString stringWithFormat:@"http://api.wmata.com/StationPrediction.svc/json/GetPrediction/C03?api_key=cja73b2fneudh86hk9x4aphr"];
- NSURLRequest *request = [NSURLRequest requestWithURL:
- [NSURL URLWithString:WMATA_URL]];
- [[NSURLConnection alloc] initWithRequest:request delegate:self];
- responseData = [[NSMutableData data] retain];
- [self.TableView reloadData];
- [self.TableView setHidden:FALSE];
- [self release];
- [refreshHeaderView finishedLoading];
- }
- //refresh methods
- - (void)pullToRefreshViewShouldRefresh:(PullToRefreshView *)view;
- {
- [self reloadTableData];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement