2012-12-14 88 views
-1

我需要的東西相當於這個目標C目標C爆炸的NSString

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

我試圖

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]; 
} 

,但我有消息

< __NSDictionaryI 0x727abc0>的setValue應用程序崩潰: forUndefinedKey:]:此類不是 ,而是密鑰XY

有什麼建議嗎?

回答

0
[postParam setValue:[keyvalue objectAtIndex:1] forKey:[NSString stringWithFormat:@"%@",[keyvalue objectAtIndex:0]]]; 
+1

thx guy!解決了! – ses3ion

+0

歡迎光臨.. :) – Rajneesh071