n cell

  }

  override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
      switch (section) {
      case 0:
          let count = self.organizedTasks.items["Aperti"]!.count
          return "Aperti (\(count))"
      case 1:
          let count = self.organizedTasks.items["Chiusi"]!.count
          return "Chiusi (\(count))"
      case 2:
          let count = self.organizedTasks.items["Scaduti"]!.count
          return "Scaduti (\(count))"
      case 3:
          let count = self.organizedTasks.items["Sospesi"]!.count
          return "Sospesi (\(count))"
      default:
          return ""
      }
  }

  func filterContentForSearchText(searchText: String, scope:String="All") {
      // Filter the array using the filter method
      self.filteredTasks = self.allTasks.filter({( task: Task) -> Bool in
          let categoryMatch = (scope == "All") || (task.priorita == scope)
          let stringMatch = task.titolo.rangeOfString(searchText)
          return categoryMatch && (stringMatch != nil)
      })
  }

  func searchDisplayController(controller: UISearchDisplayController, shouldReloadTableForSearchString searchString: String!) -> Bool {
      self.filterContentForSearchText(searchString)
      return true
  }

  func searchDisplayController(controller: UISearchDisplayController, shouldReloadTableForSearchScope searchOption: Int) -> Bool {
      self.filterContentForSearchText(self.searchDisplayController!.searchBar.text)
      return true
  }

  // In a storyboard-based application, you will often want to do a little preparation before navigation
  override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?)     {
      // Get the new view controller using [segue destinationViewController].
      // Pass the selected object to the new view controller.
  }

}

I don't know why these two things happen. It seems that it can't create another cell with "Cell" identifier but this is strange because when the table is loaded (without using the search bar) all i