title: Swift index 0 beyond bounds for empty array in tableview
body: <p>I'm trying to populate tableview with parse with 2 labels connected to the the main tv controller with PFTableViewCell</p>
  
  <p>when I add the (numberOfSectionsInTableView + numberOfRowsInSection ) the app crash </p>
  
  <p>but when I deleted it it works but it show nothing.</p>
  
  <p><img src="https://i.stack.imgur.com/7Hi6l.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/KLrz2.png" alt="enter image description here"></p>
  
  <p>This the table view cell</p>
  
  <pre><code>class courseCell: PFTableViewCell {
  
      @IBOutlet var name: UILabel!
  
      @IBOutlet var location: UILabel!
  
  }
  </code></pre>
  
  <p>This the table view controller </p>
  
  <pre><code>class courseTVC: PFQueryTableViewController {
  
  
  override init!(style: UITableViewStyle, className: String!) {
      super.init(style: style, className: className)
  }
  
  
  required init(coder aDecoder:NSCoder)
  {
      super.init(coder:aDecoder)
  
  
  
      self.parseClassName = "courses"
      self.textKey = "Location"
      self.pullToRefreshEnabled = true
      self.paginationEnabled = false
  
  }
  override func queryForTable() -&gt; PFQuery! {
      var query = PFQuery(className: "courses")
      query.orderByDescending("Location")
      return query
  }
  
  
    override func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
          return 1
      }
  
  override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return 4
  }
  
  
  override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!, object: PFObject!) -&gt; PFTableViewCell {
      var cell = tableView.dequeueReusableCellWithIdentifier("cell" , forIndexPath : indexPath) as? courseCell
      if cell == nil
      {
          cell = courseCell(style: UITableViewCellStyle.Default, reuseIdentifier: "cell")
      }
  
  
      cell!.name.text = object["Price"] as! String!
      cell!.location.text = object["Location"] as! String!
  
  
  
  
      return cell!
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ERNKr.png" alt="debugging message"></p>
  
  <p>I don't know how to fix this issue </p>