Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
URL Query to Dict
NSArray *parameters = [[url query] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"=&"]];
NSMutableDictionary *keyValueParm = [NSMutableDictionary dictionary];
for (int i = 0; i < [parameters count]; i=i+2) {
[keyValueParm setObject:[parameters objectAtIndex:i+1] forKey:[parameters objectAtIndex:i]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment