I'm receiving a JSON value from a rest api like this.
"['value1,'value2']"
However, how do I convert that to an NSMutableArray? the said value is received as a NSString.
I'm receiving a JSON value from a rest api like this.
"['value1,'value2']"
However, how do I convert that to an NSMutableArray? the said value is received as a NSString.
if your string has a json format you could try:
//content is your string
NSData *data = [content dataUsingEncoding:NSUTF8StringEncoding];
id json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
//access json as an array.
[json objectAtIndex:0];