Sunday, 25 August 2013

How to get rid of multiple sets of parentheses in an array

How to get rid of multiple sets of parentheses in an array

I'm using RESTKit to do some object mapping for a JSON and I'm mapping an
array. The JSON that I'm mapping looks like this:
"parameters":[{"parameter_value":["Smith"]}, {"parameter_value":[66211]}]
The array that I'm getting looks like this:
Parameter Value: (
(
Smith
),
(
66211
)
)
When I try to convert the array to a string via this code: NSString
*nameidvalue = [[parameterValueArray valueForKey:@"description"]
componentsJoinedByString:@""]; The string nameidvalue turns into this:
(
Smith
)(
66211
)
How exactly do I get rid of the parentheses so what I'm left with is
Smith, 66211

No comments:

Post a Comment