Last active
December 18, 2015 03:29
-
-
Save arielelkin/5718605 to your computer and use it in GitHub Desktop.
LocoQuizz functions
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)createVenuesDict:(NSArray *)allVenues{ | |
venuesDict = [NSMutableDictionary dictionary]; | |
//Only get the venues' names and categories | |
for(NSDictionary *singleVenue in allVenues){ | |
NSArray *categories = [singleVenue valueForKey:@"categories"]; | |
if(categories){ | |
[self.venuesDict setValue:[categories valueForKey:@"name"][0] forKey:[singleVenue valueForKey:@"name"]]; | |
} | |
} | |
NSLog(@"venues: %@", self.venuesDict); | |
[self nextQuestion]; | |
} |
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)fetchGameContent{ | |
//get the base URL string | |
NSString *baseString = @"https://api.foursquare.com/v2/venues/search"; | |
//make our query string | |
NSString *queryString = [NSString stringWithFormat:@"?ll=%f,%f", self.userLocation.latitude, self.userLocation.longitude]; | |
//add the API Keys | |
NSString *apiKeyString = [NSString stringWithFormat:@"&client_id=CPG1OA2FD0OE43PLES4MFOK133GSJADXF3DUMLO4CG0TKOEV&client_secret=30UCWAOGHIVF1C3MSUQ1RNPEUBKO20S01DQCWUQ0LEKCNE4D&v=20130126"]; | |
//concatenate all strings: | |
NSString *requestString = [[baseString stringByAppendingString:queryString] stringByAppendingString:apiKeyString]; | |
// NSLog(@"I got: %@", requestString); | |
//make a NSURLRequest | |
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:requestString]]; | |
//Fetch the data! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment