Skip to content

Instantly share code, notes, and snippets.

@nickdowell
Created January 9, 2013 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickdowell/4492320 to your computer and use it in GitHub Desktop.
Save nickdowell/4492320 to your computer and use it in GitHub Desktop.
parsing query parameters from an NSURL
NSMutableDictionary *queryParameters = [NSMutableDictionary dictionary];
for (NSString *string in [[URL query] componentsSeparatedByString:@"&"]) {
NSArray *array = [string componentsSeparatedByString:@"="];
if ([array count] == 2)
[queryParameters setObject:[array objectAtIndex:1] forKey:[array objectAtIndex:0]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment