Last active
August 29, 2015 14:00
-
-
Save wavecos/11222159 to your computer and use it in GitHub Desktop.
lesly-carlos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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