Created
January 9, 2013 11:01
-
-
Save nickdowell/4492320 to your computer and use it in GitHub Desktop.
parsing query parameters from an NSURL
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
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