After json parsing i get the dictionary values like this way
NSDictionary* json = [NSJSONSerialization JSONObjectWithData:responseData //1
options:kNilOptions error:&error];
After printing the json dictionary i get the below output
{
Title= "hi";
title2 = "welcome";
FriendlyName = B325;
Id = 1;
MyLocation = "opp";
sliders = (
{
NAme1 = hai;
Name2 = "apple";
Name3 = "world";
Name4 = "happiness";
}
);
Address = "northZone";
Title3 = "hello world";
},
{
title= "hi";
title2 = "welcome";
FriendlyName = B325;
Id = 2;
MyLocation = "opp1";
sliders = (
{
NAme1 = hai;
Name2 = "apple";
Name3 = "world";
Name4 = "happiness";
}
);
Address = "westZone";
Title3 = "hello world";
},
title= "hi";
title2 = "welcome";
FriendlyName = B325;
Id = 3;
MyLocation = "opp";
sliders = (
{
NAme1 = hai;
Name2 = "apple";
Name3 = "world";
Name4 = "happiness";
}
);
Address = "southZone";
Title3 = "hello world";
},
'''''''''etc.,
NSMutableArray *resultArray = [json objectForKey:@"title"];
i want to store the dictionary strings into resultarray but execution has stopped in the above step
How will i store the dictionary values into an array?
please help me
From the output you show, it looks like your JSON object is already an array of dictionaries. However, your statement/question does not make sense to me, so I can’t figure out what you really want.
There are more fancy ways to access your data, but this should give you a basic idea and hopefully get you on your way…
From here, you should be able to verify what you have. I bet you are getting an array of dictionaries. At that point, just iterate over the top level array and query each dictionary for its contents.