I have a Json File and there is a item like this: "image":"https://xxxxxxxxxxx.jpg"
So I'm trying this:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell : TableViewCell! = tableView.dequeueReusableCellWithIdentifier("Cell") as! TableViewCell
let strName : NSString=arrDict[indexPath.row] .valueForKey("name") as! NSString
let strSubtitle : NSString=arrDict[indexPath.row] .valueForKey("subtitle") as! NSString
let strLocation : NSString=arrDict[indexPath.row] .valueForKey("location") as! NSString
let strStart : NSString=arrDict[indexPath.row] .valueForKey("start") as! NSString
// let strImage : NSString=arrDict[indexPath.row] .valueForKey("image") as! NSString
// let strImage : NSData=arrDict[indexPath.row] .valueForKey("image") as! NSData
let strImage : UIImage=arrDict[indexPath.row] .valueForKey("image") as! UIImage
cell.lbName.text=strName as String
cell.lbSubtitle.text=strSubtitle as String
cell.lbStart.text=strStart as String
cell.lbLocation.text=strLocation as String
cell.lbImage.image=strImage as UIImage
return cell as TableViewCell
}
And after Run this message display:
Could not cast value of type '__NSCFString' (0x1112ca090) to 'UIImage' (0x11222b800).
Thank You.