konnte mit swift 3 @ keine Zelle aus ihrer dataSource abruf

Ich habe den folgenden UITableViewController als searchResultsController angehängt:

import UIKit
import MapKit

class LocationSearchTable : UITableViewController {
    var matchingItems:[MKMapItem] = []
    var mapView: MKMapView? = nil

    override func viewDidLoad() {
        super.viewDidLoad()

        tableView.dataSource = self
        tableView.delegate = self
    }
}

extension LocationSearchTable : UISearchResultsUpdating {
    func updateSearchResults(for searchController: UISearchController){
        guard let mapView = mapView,
            let searchBarText = searchController.searchBar.text else { return }
        let request = MKLocalSearchRequest()
        request.naturalLanguageQuery = searchBarText
        request.region = mapView.region
        let search = MKLocalSearch(request: request)
        search.start { response, _ in
            guard let response = response else {
                return
            }
            self.matchingItems = response.mapItems
            self.tableView.reloadData()
        }
    }

}

extension LocationSearchTable {
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        print(matchingItems.count)
        return matchingItems.count
    }

     func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell")!
        let selectedItem = matchingItems[indexPath.row].placemark
        cell.textLabel?.text = selectedItem.name
        cell.detailTextLabel?.text = ""
        return cell
    }
}

Hier ist es einmal abgestürztmatchingItems.count ist nicht gleich 0 zum Beispiel:

0 0 10 20.10.2016 15: 43: 53.914 ios-App [9137: 977735] * Assertionsfehler in - [UITableView _configureCellForDisplay: forIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3599.6/UITableView.m:8035 2016-10-20 15: 43: 53.927 ios-App [9137: 977735] * Das Beenden der App aufgrund der nicht erfassten Ausnahme "NSInternalInconsistencyException", Grund: "UITableView (; layer =; contentOffset: {0, -64}; contentSize: {768, 440}>) konnte keine Zelle aus ihrer dataSource abrufen.

Wenn ich Debugging-Punkte hinzufüge, bei denen cellForRowAtIndexPath nie erreicht wird, scheint die App vor diesem Punkt abgestürzt zu sein?

Antworten auf die Frage(4)

Ihre Antwort auf die Frage