Created
December 10, 2014 17:55
num_queryArguments for multiple params
This file contains hidden or 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
- (NSDictionary *)num_queryArguments | |
{ | |
NSMutableDictionary *returnArgs = [NSMutableDictionary dictionary]; | |
NSString *query = [self query]; | |
NSArray *strURLParse = [query componentsSeparatedByString:@"?"]; | |
for(int j=0; j < [strURLParse count]; j++) { | |
NSArray *arrQueryString = [[strURLParse objectAtIndex:j] componentsSeparatedByString:@"&"]; | |
for (int i=0; i < [arrQueryString count]; i++) { | |
NSArray *arrElement = [[arrQueryString objectAtIndex:i] componentsSeparatedByString:@"="]; | |
if ([arrElement count] == 2) { | |
[returnArgs setObject:[[arrElement objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] forKey:[[arrElement objectAtIndex:0] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; | |
} | |
} | |
} | |
NSLog(@"Parts are %@", returnArgs); | |
return returnArgs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment