You need to split the string into &, but not into &.
Is there a more elegant way to code this, and not just replace it and then split by &? Like this...
query = [query stringByReplacingOccurrencesOfString:@"&" withString:@"~~~"];
NSArray * kvpairs = [query componentsSeparatedByString:@"&"];
NSMutableArray *mArr = [[NSMutableArray alloc] init];
for (NSString *kvp in kvpairs) {
[mArr addObject:[kvp stringByReplacingOccurrencesOfString:@"~~~" withString:@"&"]];
}
kvpairs = [NSArray arrayWithArray:mArr];
[mArr release];
tdios source
share