iphone JSON Parsing.. How can i parse this data
this is the print screen of nsmutablearray.
this 2409,2410,2412 is not fix key. it coming dynamically.
{
开发者_如何学编程2409 = (
{
AltSelectionPrice = "2.00";
},
{
AltSelectionPrice = "3.00";
}
);
2410 = (
{
AltSelectionPrice = "7.00";
},
{
AltSelectionPrice = "0.00";
}
);
2412 = (
{
AltSelectionPrice = "0.00";
},
{
AltSelectionPrice = "9.00";
},
{
AltSelectionPrice = "5.00";
}
);
}
thnx in advance.
I am currently on my work computer which runs Windows so cannot post exact code. But what you need to do is get hold of dictionary in the array. May be like following:
NSDictionary* dict = [myMutableArray objectAtIndex:0];
and then iterate over keys in the dictionary:
for (id key in [dict keyEnumerator]) {
//use the key or get the object of that key using [dict objectForKey:key]
}
Update: I assumed you are getting this array from a JSON parser!
精彩评论