title: Error While Loading Table After Swift 2 Upgrade - IOS
body: <p>When I try to make a dynamic table view with the code below I get the error "unexpectedly found nil while unwrapping an Optional value". Any ideas? I checked the array with print() but they are not empty.</p>
  
  <pre><code>import UIKit
  
   class mainVC: UIViewController, UITableViewDataSource, UITableViewDelegate {
  
  
  @IBOutlet weak var resultsTable: UITableView!
  
  
  var resultsNameArray = [String]()
  var resultsAlloCommentArray = [String]()
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
  
      let theWidth = view.frame.size.width
      let theHeight = view.frame.size.height
  
  
      resultsTable.frame = CGRectMake(0, 0, theWidth, theHeight)
  
  
  
      refreshResults()
  
  
  }
  
  
  
  
  func refreshResults() {
  
  
      resultsNameArray.removeAll(keepCapacity: false)
      resultsAlloCommentArray.removeAll(keepCapacity: false)
  
  
      let query = PFQuery(className: "posts")
      query.addDescendingOrder("createdAt")
      query.includeKey("relUserPointer")
      query.limit = 10
  
      query.findObjectsInBackgroundWithBlock {
          (objects:[PFObject]?, error:NSError?) -&gt; Void in
  
          if error == nil {
  
              for object in objects! {
  
                  self.resultsNameArray.append(object.objectForKey("profileName") as! String)
                  self.resultsAlloCommentArray.append(object.objectForKey("relUserPointer")!.objectForKey("settingAllowComment") as! String)
  
              }
  
  
          }
      print(self.resultsNameArray)
          print(self.resultsAlloCommentArray)
           self.resultsTable.reloadData()
  
      }
  
  }
  
  
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  
  override func viewWillAppear(animated: Bool) {
  
  
  }
  
  
  
  
  override func viewDidAppear(animated: Bool) {
  
  
  
  }
  
  
  
  
  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
  
  
  
  
      return 10
  
  
  }
  
  
  
  func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -&gt; CGFloat {
  
  
  return  127
  
  }
  
  
  
  
      func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      //here I get the error in the dequeueReusableCellWithIdentifier
       let cell:mainCell = tableView.dequeueReusableCellWithIdentifier("Cell") as! mainCell
  
  
      cell.profileLbl.setTitle(self.resultsNameArray[indexPath.row], forState: UIControlState.Normal)
  
  
  
  
      return cell
  
  }
  
  
  
  
    }
  </code></pre>