iphone - Convert NSString into NSMutableArray (specific String) -


i have string

test string =====>{"name":"0","age":"0","sex":"0","weight":"0"}

want string array of type:

myarray[0]="name"; myarray[1]="age"; myarray[2]="sex"; myarray[3]="weight"; 

please idea crack thing.. in advance.

try

    nsarray *arrcomponents = [str componentsseparatedbystring:@","];     nsmutablearray *arrmfilter = [[nsmutablearray alloc] init];      for(int = 0; < [arrcomponents count] ;i++)     {         nsstring *str = [arrcomponents objectatindex:i];         str = [str stringbyreplacingoccurrencesofstring:@":" withstring:@""];         str = [str stringbyreplacingoccurrencesofstring:@"\"" withstring:@""];         str = [str stringbyreplacingoccurrencesofstring:@"{" withstring:@""];         str = [str stringbyreplacingoccurrencesofstring:@"}" withstring:@""];         str = [str stringbyreplacingoccurrencesofstring:@"0" withstring:@""];          [arrmfilter addobject:str];     }      nslog(@"filtered array = %@", arrmfilter); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -