I am using a PFQueryTableViewController to try to load data into a tableview.
EDIT: link to photo referred to just below: http://i61.tinypic.com/x5626a.png
To my knowledge everything is set up correctly, but when running in the simulator, no images or text appear. The query loads the correct number of cells though: There are 14 objects in my "Post" class, and the simulator loads 14 table cells, but they all just appear as in the photo above. There are also 2 labels in the tableview (which I pre-populated in the attributes inspector with text) and that text doesn't show up either.
EDIT 2:
I have figured out how to display text in the cell, but I can not get how to display the image. This is my code in my cellForRowatIndexPath:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject!) -> PFTableViewCell? {
//4
let cell = tableView.dequeueReusableCellWithIdentifier("Cell1", forIndexPath: indexPath) as! DataCell
let Postobject1 = object as! Post
cell.shortDescriptionLabel.text = Postobject1["short_decription"] as? String
cell.userUsername.text = Postobject1["user2"] as? String
var thumbnail: PFFile = Postobject1["fichierimage"] as! PFFile
cell.contentImage.file = thumbnail
return cell
}
the code works correctly to display the strings, shortDescriptionLabel and userUserName. But it does not work to load the image. I took this code:
var thumbnail: PFFile = Postobject1["fichierimage"] as! PFFile
cell.contentImage.file = thumbnail
from the Parse site, here: http://i60.tinypic.com/2ziq0hu.png
however when I clicked "swift" it said there is no swift example, so that is my translation of the code. I've never programmed in Obj-C before so maybe I translated it wrong. Could someone help with a swift translation please?