When i request to my web server it send me Json string in request.response.i want to store that json into NSDictionary for parsing and storing it into database. My Json format is
{ "rowNumber" : 3,
[ { "Age" : "2 - 4 years old ",
"AndroidID" : "2",
"Category" : "Chanson",
"Description" : "fourni",
"Size" : 3447196,
"Thumbnail" : null,
"Title" : "test",
"iTunesID" : "2",
"inactive" : false,
"product_id" : 2} ],
[ { "Age" : "2 - 4 years old ",
"AndroidID" : "3",
"Category" : "Chanson",
"Description" : "Animation ",
"Size" : 3447196,
"Thumbnail" : null,
"Title" : "Escargot",
"iTunesID" : "3",
"inactive" : false,
"product_id" : 3
} ]
}
IF i use this code to print String by string to NSlog it display fine but How i can i store that into NDdictionary ??
NSString *response = [[request responseString] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
To store into dictionary i tried this code but this store my json in reverse order
NSDictionary* json = [NSJSONSerialization
JSONObjectWithData:request.responseData
options:kNilOptions
error:&error];
for(NSString *key in [json allKeys]) {
NSLog(@"%@",[json objectForKey:key]);
it store it into reverse order. Any help is appreciated.I am using ASIFormDataRequest for networking.