So, this is a multi page application and whenever I switch to the page with the UITable present in it I face this error " setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tableView." I got the same error before cause I forgot to add the numberOfRowsInSection function but even after adding that still I am facing the same error.
class workingQuery: UIViewController, UITableViewDelegate, UITableViewDataSource{
@IBOutlet weak var tableViews: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated
}
//TableView Code
var names = ["Mark", "Cloyd", "Buck", "Steve", "Wallace"]
var breeds = ["Labrador Retriver", "Bulldog", "German Shepherd", "Golden Retriver", "Yorkshire"]
var images = [UIImage(named:"johnny"), UIImage(named:"dusra"), UIImage(named:"Third"), UIImage(named:"Fourth"), UIImage(named:"Fifth")]
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 5
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = self.tableViews.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! CustomCell
cell.photo.image = images[indexPath.row]
cell.fullName.text = names[indexPath.row]
cell.ageSex.text = breeds[indexPath.row]
return cell
}
}