Hadi
Hadi

Reputation: 1212

Help needed with json iphone

I m receiving data from the server. Now when i m deserializing it i m getting an array with key value. Now the first object of the array is my whole NSDictionary item from which i have to extract data using keys. I m stuck here i tried using different things like extracting them in sets but it disturbs there arrangement. I m pretty new in the field . please can anyone help me out here. How to get that array into a NSDictionary object or extract info using keys from that array. Thanks.

NSData *responseData = [[request responseString] dataUsingEncoding:NSUTF8StringEncoding];
NSError *err = nil;
NSDictionary *dataArray = [[CJSONDeserializer deserializer]deserialize:responseData error:&err];

it gves an array as output to me.

Upvotes: 1

Views: 73

Answers (2)

btt
btt

Reputation: 422

I highly recommend the SBJson framework as a production ready library for dealing with just such issues.

Upvotes: 0

Dylan Reich
Dylan Reich

Reputation: 1430

How about: NSDictionary *myDictionary = [myArray objectAtIndex:0];

Upvotes: 1

Related Questions