I have this JSON response string:
{"d":"{\"ID_usuario\":\"000130\",\"Nombre\":null,\"Vipxlo\":0,\"Provmun\":null,\"Descuentos\":null,\"Listaviplocal\":null}"}`
With this code:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
//Check valid signal
connection = nil;
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
//data =nil;
NSArray *jsonArray = [responseString JSONValue];
How can I do it?
When you can afford to require iOS 5 you should try NSJSONSerialization.
Your code could look like this but I suggest reading the Docs first.
NSArray* jsonArray = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableLeaves error:someError]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With