title: Set PFQueryTableViewCell imageView as a local image
body: <p>[Developing for iOS using Swift]</p>
  
  <p>I am pulling data from Parse and populating a PFQueryTableView with it, and based on one of the values of the PFObjects that I am using to populate the tableView, I would like to set the imageView of the cell to an image stored locally in my Xcode images.xcassets.</p>
  
  <p>This is my code:</p>
  
  <pre><code>// Set cells for each row of table
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject?) -&gt; PFTableViewCell? {
  
      var cell = tableView.dequeueReusableCellWithIdentifier("Cell") as! PFTableViewCell!
      if cell == nil {
          cell = PFTableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "Cell")
      }
  
      // Set image as read/unread
  
      if let readStatus = object!["readStatus"] as? String {
  
          if readStatus == "unread" {
              cell.imageView?.image = UIImage(named: "unreadImage")
          } else if readStatus == "read" {
              cell.imageView?.image = UIImage(named: "readImage")
          }
  
      }
  
      return cell
  
  }
  </code></pre>
  
  <p>But it does not set the image...</p>
  
  <p>If I change this line with a ! after imageView (like so): <code>cell.imageView!.image = UIImage(named: "readImage")</code></p>
  
  <p>I get the error:</p>
  
  <pre><code>fatal error: unexpectedly found nil while unwrapping an Optional value
  </code></pre>
  
  <p>So how can I set the cell's image based on a Parse value (but I want the image to be a local image)</p>