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. No开发者_运维技巧w 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.
How about: NSDictionary *myDictionary = [myArray objectAtIndex:0];
I highly recommend the SBJson framework as a production ready library for dealing with just such issues.
精彩评论