I want to create JSON string like {“search_element”: “New York”} this. I used following code for that.
NSString *JSONString = [NSString stringWithFormat:@"{\"search_element\":""\"%@\"""}",
[searchName stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
After doing this I am getting value like {“search_element”:”New%20York”} this. I want it should be New York instead New%20York. I am not getting How to format it for expected result.Please help me.
you can simply call next
However look into JSONKit and SBJSON ..they have methods to make valid JSON in iOS