title: "Attempt to delete row from section 1, but there are only 1 sections before update"
body: <p>I'm trying to delete the rows that don't meet the criteria in the for loop. However, I'm getting and error that says: 'attempt to delete row 0 from section 1, but there are only 1 sections before the update." I'v never seen this before and not sure why I am getting it. </p>
  
  <p>My code:</p>
  
  <pre><code> func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
  
      let cell = theTableView.dequeueReusableCellWithIdentifier("MyCell") as! TableViewCell
      cell.titleLabel.text = titles[indexPath.row]
      cell.priceLabel.text = prices[indexPath.row]
      cell.descLabel.text = descs[indexPath.row]
      cell.itemImage.image = itemImages[indexPath.row]
      cell.userNumber = phoneNumbers[indexPath.row] as! String
      cell.timeLabel.text = datesHours[indexPath.row]! + "hr"
      cell.distanceLabel.text = String(locations[indexPath.row]!) + "mi"
      cell.viewController = self
  
  
  
  
      self.theTableView.beginUpdates()
  
      for (index, number) in self.locations {
          if number &lt;= 5 {
              let indexPath = NSIndexPath(forRow: number, inSection: 1)
              self.theTableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
  
          }
      }
      self.theTableView.endUpdates()
  </code></pre>