title: Custom cell: fatal error: unexpectedly found nil while unwrapping an Optional value
body: <p>I have a table view with custom cell that was created as .xib . I didnt use storyboard. I have a problem that I couldnt fill my table with the data which came from webservice result. Also, I have 4 labels in the custom cell. In my custom cell class, when I try to set labels for each items, It gives me fatal error like above.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
  ...
  
  func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -&gt; UITableViewCell!
  {
          let cell: ItemManagementTVCell = tableView?.dequeueReusableCellWithIdentifier("cell") as ItemManagementTVCell
  
      if let ip = indexPath
      {
          let item: Item = self.itemList[indexPath.row] as Item
          cell.setCell(item.itemName, status: item.itemStatus, duration: item.itemDuration, price: item.itemPrice)
      }
      return cell
  }
  }
  </code></pre>
  
  <p>And my custom cell class is here :</p>
  
  <p>import UIKit</p>
  
  <pre><code>class ItemManagementTVCell: UITableViewCell {
  
      @IBOutlet var lblItemName: UILabel!
      @IBOutlet var lblItemPrice: UILabel!
      @IBOutlet var lblItemDuration: UILabel!
      @IBOutlet var lblItemStatus: UILabel!
  
      override func awakeFromNib()
      {
          super.awakeFromNib()
      }
  
      override func setSelected(selected: Bool, animated: Bool)
      {
          super.setSelected(selected, animated: animated)
      }
  
      func setCell(name: String, status: Int, duration: Int, price: Int)
      {
          self.lblItemName.text     = name
          self.lblItemStatus.text   = String(status)
          self.lblItemDuration.text = "Duration: \(String(duration)) months"
          self.lblItemPrice.text    = String(price) + " $"
      }
  }
  </code></pre>
  
  <p>I am getting the error inside of "setCell" method block.</p>
  
  <p>I have read a lot of questions and solutions and I tried all of them it doesnt work for me.</p>
  
  <p>Thank you for your answers,</p>
  
  <p>Best regards.</p>
  
  <p><strong>SOLUTION:</strong> I've solved this problem by linking the cell items to cell's own instead of linking to File's Owner. My problem has gone by doing this.</p>