无法使用PFQueryTableViewController(Swift2)显示自定义单元格
使用parse.com v1.4(与cocoa pods一起安装)和Swift 2 +
我用自定义单元格设置了PFQueryTableViewController(ParseUI)。 我相信一切都很好,但我无法让细胞显示Parse.com的价值,即使我收到它并且可以打印它(我调试了它)。
我这样出列:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject?) -> PFTableViewCell { let cellIdentifier = "Cell" let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! OrderTableViewCell // Extract values from the PFObject to display in the table cell if let pfObject = object { // prints expected value, eg 1, 2, 3 print(pfObject["table"]) // shows "Label" which is my label's default text on the SB!! let table = pfObject["table"] as? String cell.lblTable.text = table } return cell }
我的PFQueryTableViewController的其余部分似乎从Parse加载数据OK:
我的自定义单元格OrderTableViewCell(带有一些标签IBActions):
SB设置:
结果如下:
如何让标签显示实际文本? 我错过了什么? 由于我使用Parse UI获得的附加function,我不想恢复到标准的UITableView。
事实certificate它就像改变一样简单
let table = pfObject["table"] as? String
至
let table = String(pfObject["table"])