This file contains hidden or 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
- (NSArray *)fetchPopularSearches { | |
__block NSMutableArray *result = [NSMutableArray array]; | |
NSString *searchQuery = [NSString stringWithFormat:@"url_to_flights_json"]; | |
NSURL *url = [[NSURL alloc] initWithString:searchQuery]; | |
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url]; | |
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request | |
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) | |
{ |
This file contains hidden or 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)decomposeFlightsPerHour { | |
self.decomposedFlights = [NSMutableDictionary dictionary]; | |
NSMutableArray *temp = [NSMutableArray array]; | |
NSString *currentHourPrefix = [[[self.flightList objectAtIndex:0] objectForKey:@"HP"] substringToIndex:2]; | |
NSString *dateHourPrefix = [[[self.flightList objectAtIndex:0] objectForKey:@"DATEVOL"] substringToIndex:10]; | |
NSString *newPrefix = [NSString stringWithFormat:@"%@_%@", dateHourPrefix, currentHourPrefix]; | |
for (NSDictionary *flightInfo in self.flightList) { |
This file contains hidden or 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
{ | |
"id": 27, | |
"description": "Raviver la flamme, c est mettre du piment dans sa vie de couple. Savez vous le surprendre ? Faîtes le test !", | |
"urlKey": "/api/v1/fr/tests/27", | |
"title": "Savez-vous le surprendre?", | |
"target_sex": "", | |
"credits": 15, | |
"logo": "", | |
"pictureURL": "/images/img_atoutsSeduction.png", | |
"score_based": false, |
This file contains hidden or 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
{ | |
"id": 27, | |
"description": "Raviver la flamme, c est mettre du piment dans sa vie de couple. Savez vous le surprendre ? Faîtes le test !", | |
"urlKey": "/api/v1/fr/tests/27", | |
"title": "Savez-vous le surprendre?", | |
"target_sex": "", | |
"credits": 15, | |
"logo": "", | |
"pictureURL": "/images/img_atoutsSeduction.png", | |
"score_based": false, |
This file contains hidden or 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
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"REST URL PATH"]]; | |
NSData *imageData = UIImageJPEGRepresentation(image, 1.0); | |
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; | |
[request setHTTPShouldHandleCookies:NO]; | |
[request setTimeoutInterval:60]; | |
[request setHTTPMethod:@"POST"]; | |
NSString *boundary = @"unique-consistent-string"; |
OlderNewer