从Parse访问字典数据并在Tableview Cell上显示

时间:2015-08-17 19:15:25

标签: swift uitableview dictionary parse-platform

我有一个带有字典属性的对象我试图访问并显示在tableview单元格上。我之前没有处理字典类型数据,所以显示它有点让我感到困惑..

这是对象。它来自PoolAccount类,我想访问的数据位于" serviceHistory"

列中
var poolHistory:PFObject = PFObject(className: "PoolAccount")
 Print(poolHistory.valueForKey("serviceHistory")!.count!)
 //returns this data

enter image description here

enter image description here

enter image description here

  //How do i cast this data so i can use it in a tableview cell?
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! UITableViewCell


  cell.textLabel?.text = ??

1 个答案:

答案 0 :(得分:1)

我认为您应该将“serviceHistory”列类型更改为Object。 您可以使用NSDictionary

Application.OnKey