Skip to content

Instantly share code, notes, and snippets.

@casspangell
Last active December 28, 2015 17:19
Show Gist options
  • Save casspangell/7535529 to your computer and use it in GitHub Desktop.
Save casspangell/7535529 to your computer and use it in GitHub Desktop.
-(void) processResponseData: (NSDictionary *) responseData {
// NSLog(@"%@", responseData);
NSArray *arrayOfLocations = [responseData objectForKey:@"data"];
NSDictionary *place = [arrayOfLocations objectAtIndex:2];
NSString *placeName = [place objectForKey:@"name"]; // aka Quiznos
NSString *category = [place objectForKey:@"category"]; // aka Food/beverages
NSArray *arrayOfCategoryList = [place objectForKey:@"category_list"];
NSDictionary *placeIDAndType = [arrayOfCategoryList objectAtIndex:0];
NSString *placeType = [placeIDAndType objectForKey:@"name"]; //aka Sandwich Shop
NSLog(@"%@ %@ %@", placeName, category, placeType);
for (id key in place) {
// NSLog(@"key: %@ value: %@", key, [place objectForKey:key]);
}
NSDictionary *placeLocationData = [place objectForKey:@"location"];
for (id key in placeLocationData) {
// NSLog(@"key: %@ value: %@", key, [placeLocationData objectForKey:key]);
}
double latitude = [[placeLocationData objectForKey:@"latitude"] doubleValue];
double longitude = [[placeLocationData objectForKey:@"longitude"] doubleValue];
NSLog(@"%f, %f", latitude, longitude);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment