开发者

iphone JSON Parsing.. How can i parse this data

开发者 https://www.devze.com 2023-01-19 00:29 出处:网络
this is the print screen of nsmutablearray. this 2409,2410,2412 is not fix key. it coming dynamically.

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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号