【发布时间】:2015-08-17 19:15:24
【问题描述】:
我有一个带有字典属性的对象,我正在尝试访问并显示在 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 = ??
【问题讨论】:
-
你能贴一张你在 parse 中的课程图片吗
-
我用几张图片更新了它@Lamar,它是一个字典值数组。
-
您必须使用 findObjectsInBackgroundWithBlock 从后台查询那些对象 将其保存到字典中,然后您可以将其填充到单元格中
-
无论如何要获取当前对象而不是我的 tableview 并将其转换为字典?
-
我不太明白你刚才说什么。?
标签: swift uitableview dictionary parse-platform