public
Created

URL Query to Dict

  • Download Gist
gistfile1.txt
1 2 3 4 5 6
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]];
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.