我得到串這是 字符串* NEWID = @「12390,12391,12392,12394,12394,12395,12396」添加數據串陣列
這是請求發送給我。
我需要從字符串中添加每個id到NSMutableArray或NSMutableDictionary中。
我得到串這是 字符串* NEWID = @「12390,12391,12392,12394,12394,12395,12396」添加數據串陣列
這是請求發送給我。
我需要從字符串中添加每個id到NSMutableArray或NSMutableDictionary中。
NSString *[email protected]"12390,12391,12392,12394,12394,12395,12396";
NSMutableArray *arrayIds = [[newID componentsSeparatedByString:@","] mutableCopy];
array = [newID componentsSeparatedByString:@「,」];
嘗試
NSString *[email protected]"12390,12391,12392,12394,12394,12395,12396";
NSArray *arrays = [newID componentsSeparatedByString:@","];
NSMutableArray *arr = [NSMutableArray arrayWithArray:arrays];
NSString *[email protected]"12390,12391,12392,12394,12394,12395,12396";
NSArray *arrayIds = [newID componentsSeparatedByString:@","];
NSString *str1=[arrayIds objectAtIndex:0];
NSString *str2=[arrayIds objectAtIndex:1];
.
.
.
的NSString * NEWID = @ 「12390,12391,12392,12394,12394,12395,12396」;
array = [newID componentsSeparatedByString:@「,」];
(如果使用其他方法)[array retain];
其工作NSArray ..... – 2011-05-19 10:46:13
我們可以做到這一點 NSMutableArray或NSMutableDictionary – 2011-05-19 10:53:44
更新我的答案nsmutablearray – Eimantas 2011-05-19 11:14:19