How can i convert this JSON array:
This is a serialized JSON array
2012-06-18 09:22:07.647 TableView[468:f803] (
{
"Countries" = Iceland;
"id"=9046567;
"name"=abceeeffdsg;
},
{
"Countries" = Greenland;
"id"=3524695;
"name"=gsfjgfsethju;
},
{
"Countries" = Switzerland;
"id"=4613583;
"name"=hdfkdgs;
)
But I need to convert this arrays into following arrays:
{
NSArray* Countries = (
Iceland,
Greenland,
Switzerland,
);
NSArray *id=(9046567,3524695,4613583 );
NSArray * name=(abceeeffdsg,gsfjgfsethju,hdfkdgs);
}
Or else i just wanted to display these items on my table view as a cell..
anyone can suggest some codes and explain this….
This will fetch all countries into an array:
Note that the second snippet of yours is an
NSDictionarywith one key (‘Countries’) and an array of values. So it’s not just ‘an array’…So, if you would really like to have it like this you could do: