Using parse.com v1.4 (installed with cocoa pods) with Swift 2 +
I've setup up my PFQueryTableViewController (ParseUI) with a custom cell. I believe everything is hooked up fine, however I can't get the cell to display the value from Parse.com even though I do receive it and can print it (I've debugged it).
I am dequeueing like this:
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, e.g. 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
}
The rest of my PFQueryTableViewController which seems to load data OK from Parse:
My custom cell OrderTableViewCell (with some label IBActions):
SB set-up:
And the result:
How can I get the label to display the actual text? What am I missing? I don't want to revert back to standard UITableView due to the additional features I get with Parse UI.
turns out it was as simple as changing
let table = pfObject["table"] as? String
to
let table = String(pfObject["table"])