Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can easily parse the values using json parser. See the following code for Foursquare venue Search Parsing.</p> <pre><code> -(NSMutableArray*)returnVenuesDetails:(NSDictionary*)result{ NSArray *groupsArray = [[(NSDictionary*)result objectForKey:@"response"] objectForKey:@"groups"]; NSArray *itemsArray; if([groupsArray count] &gt; 0){ itemsArray = [[groupsArray objectAtIndex:0] objectForKey:@"items"]; NSMutableArray *resultArray = [NSMutableArray array]; if([itemsArray count] &gt; 0){ for (int i=0; i&lt;[itemsArray count]; i++) { NSMutableDictionary *resultDictionary=[[NSMutableDictionary alloc] init]; NSString *venueId = [[itemsArray objectAtIndex:i] objectForKey:@"id"]; NSString *venueName = [[itemsArray objectAtIndex:i] objectForKey:@"name"]; [resultDictionary setObject:venueId forKey:@"venueId"]; [resultDictionary setObject:venueName forKey:@"venueName"]; //Get Stats details NSDictionary *stats = [[itemsArray objectAtIndex:i] objectForKey:@"stats"]; NSString *checkinsCount = [stats objectForKey:@"checkinsCount"]; NSString *tipCount = [stats objectForKey:@"tipCount"]; NSString *usersCount = [stats objectForKey:@"usersCount"]; [resultDictionary setObject:checkinsCount forKey:@"checkinsCount"]; [resultDictionary setObject:tipCount forKey:@"tipCount"]; [resultDictionary setObject:usersCount forKey:@"usersCount"]; NSArray *catArray = [[itemsArray objectAtIndex:i] objectForKey:@"categories"]; if([catArray count]&gt; 0){ //Get Category List NSDictionary *categoryDic = [catArray objectAtIndex:0]; NSLog(@"categoryDic ----- = %@",categoryDic); [resultDictionary setObject:[categoryDic objectForKey:@"icon"] forKey:@"icon"]; [resultDictionary setObject:[categoryDic objectForKey:@"id"] forKey:@"catId"]; [resultDictionary setObject:[categoryDic objectForKey:@"name"] forKey:@"catName"]; } //Add dictionary into Array [resultArray addObject:resultDictionary]; } //Use this resultArray for display the Search details for (int i=0; i&lt;[resultArray count]; i++) { NSString *venueName=[[resultArray objectAtIndex:i] objectForKey:@"venueName"]; NSString *checkins=[[resultArray objectAtIndex:i] objectForKey:@"checkinsCount"]; NSLog(@"venueName = %@",venueName); NSLog(@"checkins = %@",checkins); } } return resultArray; } return [NSMutableArray array]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload