我有一个带有字典属性的对象我试图访问并显示在tableview单元格上。我之前没有处理字典类型数据,所以显示它有点让我感到困惑..
这是对象。它来自PoolAccount类,我想访问的数据位于" serviceHistory"
列中var poolHistory:PFObject = PFObject(className: "PoolAccount")
Print(poolHistory.valueForKey("serviceHistory")!.count!)
//returns this data
//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 = ??
答案 0 :(得分:1)
我认为您应该将“serviceHistory”列类型更改为Object。 您可以使用NSDictionary
Application.OnKey