-1

i need something equivalent of this in objective c

list($var1,$var2) = explode("=",$array);

i tried

NSArray *stringArray = [postString componentsSeparatedByString:@"&"];
for (NSString* str in stringArray) {
     NSArray *keyvalue = [str componentsSeparatedByString:@"="];
     [postParam setValue:[keyvalue objectAtIndex:1] forKey:[keyvalue objectAtIndex:0]];
     [postData addObject:postParam];
}

but my app crash with message

<__NSDictionaryI 0x727abc0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key XY

any suggestions?

4

1 回答 1

0
[postParam setValue:[keyvalue objectAtIndex:1] forKey:[NSString stringWithFormat:@"%@",[keyvalue objectAtIndex:0]]];
于 2012-12-14T08:42:51.953 回答