how to check valueOfKey is Array or Object when we get it from json in ios

前端 未结 2 511
一生所求
一生所求 2021-01-06 07:40

I have 2 cases to parse JSON First is:

{
    \"post_filter_data\": {
        \"Items\": [
            {
                \"ItemID\": \"50cb4e46b5         


        
2条回答
  •  礼貌的吻别
    2021-01-06 08:25

    Yes, you can check using class like

    if ([[dictMenu valueForKey:@"Items"] isKindOfClass:[NSArray class]])
    {
        // array inside
    }
    

提交回复
热议问题