title: How to update UITableviewcell label in other method in swift3?
body: <p>I am trying to update a UITableviewcell's label in other method. I also saw many post on stackoverflow, non was work for me. i am using Swift 3 and I tried this one :</p>
  
  <pre><code>    let indexPath = IndexPath.init(row: 0, section: 0)
      let cell : CategoryRow = tableView.cellForRow(at: indexPath) as! CategoryRow
  </code></pre>
  
  <p>and i am getting this error :</p>
  
  <pre><code>fatal error: unexpectedly found nil while unwrapping an Optional value
  </code></pre>
  
  <p>i am using this in other method where i update tableviewcell label text after 24hr. 
  code is here</p>
  
  <pre><code>var myQuoteArray = ["“If you have time to breathe you have time to meditate. You breathe when you walk. You breathe when you stand. You breathe when you lie down. – Ajahn Amaro”","We are what we repeatedly do. Excellence, therefore, is not an act but a habit. – Aristotle","The best way out is always through. – Robert Frost","“If you have time to breathe you have time to meditate. You breathe when you walk. You breathe when you stand. You breathe when you lie down. – Ajahn Amaro”","We are what we repeatedly do. Excellence, therefore, is not an act but a habit. – Aristotle","The best way out is always through. – Robert Frost"
  
      ]
  func checkLastRetrieval(){
  
     //        let indexPath = IndexPath.init(row: 0, section: 0)
     //        let cell : CategoryRow = tableView.cellForRow(at: indexPath) as? CategoryRow
  
  
      let indexPath = IndexPath.init(row: 0, section: 0)
     guard let cell = tableView.cellForRow(at: indexPath) as? CategoryRow else { return }
  
      print("Getting Error line 320")// This is not printing on console
  
  let userDefaults = UserDefaults.standard
  
  if let lastRetrieval = userDefaults.dictionary(forKey: "lastRetrieval") {
  if let lastDate = lastRetrieval["date"] as? NSDate {
  if let index = lastRetrieval["index"] as? Int {
  if abs(lastDate.timeIntervalSinceNow) &gt; 86400 { // seconds in 24 hours
  // Time to change the label
  var nextIndex = index + 1
  
  // Check to see if next incremented index is out of bounds
  if self.myQuoteArray.count &lt;= nextIndex {
  // Move index back to zero? Behavior up to you...
  nextIndex = 0
  }
  
  
  
  cell?.quotationLabel.text = self.myQuoteArray[nextIndex]
  
  let lastRetrieval : [NSObject : AnyObject] = [
  "date" as NSObject : NSDate(),
  "index" as NSObject : nextIndex as AnyObject
  ]
  
  userDefaults.set(lastRetrieval, forKey: "lastRetrieval")
  userDefaults.synchronize()
  }
  // Do nothing, not enough time has elapsed to change labels
  }
  }
  } else {
  
  // No dictionary found, show first quote
  cell?.quotationLabel.text = self.myQuoteArray.first!
  
       print("line 357")
  // Make new dictionary and save to NSUserDefaults
  let lastRetrieval : [NSObject : AnyObject] = [
  "date" as NSObject : NSDate(),
  "index" as NSObject : 0 as AnyObject
  ]
  
  userDefaults.set(lastRetrieval, forKey: "lastRetrieval")
  userDefaults.synchronize()
  }
  
  }
  </code></pre>
  
  <p>and Calling this method in ViewDidLoad()</p>
  
  <pre><code> override func viewDidLoad() {
      super.viewDidLoad()
  
       checkLastRetrieval()
      }
  </code></pre>
  
  <p>what should i do? 
  Thanks in Advance</p>