【问题标题】:Issue on JSON nested Array objects into TableVIewJSON 嵌套数组对象到 TableVIew 中的问题
【发布时间】:2016-03-09 17:02:47
【问题描述】:

我尝试了很多方法,但我无法从 Something 数组中获取数据并根据 indexPathUITableView 中显示它。 something 如下回复

    {
  "results": [
    {
      "Something": [
        [
          {
            "airV": "LX",
            "class": "Y"
          }
        ]
      ],

    },
    {
      "Something": [
        [
          {
            "airV": "FZ",
            "class": "Y"
          }
        ],
        [
          {
            "airV": "FZ",
            "class": "Y"
          }
        ]
      ],

    },

  ],

}

注意:something array [] ->>> 包含许多数组。循环something 数组我想得到"airV": "LX","class": "Y" airv,进入TableView

【问题讨论】:

  • 用您的尝试更新您的问题并解释您遇到的问题。
  • 我可以从单个数组 [something] 中获取数据,但我想循环多个 [something] 数组并使用基于索引的 arv、class 在 tableview 中显示数据

标签: ios objective-c json xcode ios9


【解决方案1】:

您可以存储(某物)的 NSArray 并根据 NSIndexPath 迭代该数组。

NSArray * arrayofSomething /* Your Array */
Inside your cellForRowAtIndexPath you can get the objects from arrayofSomething based on index.

Obj *obj = [arrayofSomething objectAtIndex:indexPath.row];

【讨论】:

    猜你喜欢
    • 2016-12-11
    • 2021-07-19
    • 2013-09-29
    • 2019-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-03
    • 1970-01-01
    相关资源
    最近更新 更多