In my iOS app I am trying to read in a JSON file and populate a table with its contents. Below is a sample of the JSON file.
Presently, I am reading the JSON into a mutable array called “items” and then populating the table cells like this.
// Populate the cell
if let showName = self.items[indexPath.row]["Show"] as? NSString {
cell.textLabel!.text = showName as! String
I would like to have the image for each JSON record appear in the cell as well and that is where I am getting tripped up.
I have the URL to the image but how do I get it into the table cell?
My entire approach may be wrong so I would appreciate being pointed in the right direction.
{
"shows": [{
"Day": "Sunday",
"Time": "12am",
"Show": “Show Name Here",
"imgPath": "http://remoteserver/image.jpg"
}, {
"Day": "Sunday",
"Time": "1am",
"Show": "Show Name Here",
"imgPath": “http://remoteserver/image.jpg"
}, {
"Day": "Sunday",
"Time": "2am",
"Show": "Show Name Here",
"imgPath": http://remoteserver/image.jpg"
}