I've checked my connections and class names as all the other threads with this same issue suggest.
Error message
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key parksTableView.'
View controller where I get the crash
import UIKit
class ParksViewController: UITableView, UITableViewDataSource, UITableViewDelegate {
var parkNames = ["Sunnyside", "South Oak", "Tower", "Arno", "Arbor", "Holmes", "Brookside", "Brookside Tennis Courts", "Loose", "Gilham", "Brush Creek", "Westwood"]
@IBOutlet weak var textLabel: UILabel!
@IBOutlet weak var parksTableView: UITableView!
func viewDidLoad(){
self.parksTableView.delegate = self
self.parksTableView.dataSource = self
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return parkNames.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell()
print(indexPath.row)
cell.textLabel?.text = parkNames[indexPath.row]
return cell
}
Maybe I'm just not connecting the right things to the right places? I've tried a combination of different connections and have deleted and reconnected connections many times in order to try to fix this issue, but it I still can't understand what is wrong.