Skip to content

Instantly share code, notes, and snippets.

@wavecos
Last active August 29, 2015 14:00
Show Gist options
  • Save wavecos/11222159 to your computer and use it in GitHub Desktop.
Save wavecos/11222159 to your computer and use it in GitHub Desktop.
lesly-carlos
- (void)viewDidLoad
{
[super viewDidLoad];
matchQueue = dispatch_queue_create("com.nuevatel.WorldCupApp", NULL);
dispatch_async(matchQueue, ^{
DashBoardResponse *dash = [WSManager getDashBoard];
});
[self addHeader];
[self addFooterView];
}
+(DashBoardResponse*) getDashBoard{
NSMutableString* urlString = [[NSMutableString alloc] init];
[urlString appendString:BASE_MUNDIAL_URL];
[urlString appendString:GET_DASBOARD];
[urlString appendString:DENSITY_ID];
[urlString appendString:@"hdpi"];
NSDictionary* response = [self getWSInformation:urlString];
DashBoardResponse* result = [[DashBoardResponse alloc] initWithDictionary:response];
dispatch_async(dispatch_get_main_queue(), ^ {
self.dasboard = result:
[self.matchestableView reloadData];
});
return result;
}
+(NSDictionary *) getWSInformation: (NSString *) urlString {
NSURL *url = [NSURL URLWithString:urlString];
NSData *data = [NSData dataWithContentsOfURL:url];
NSDictionary *response = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
return response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment