ios – Swift error Cannot find ‘table1’ in scope


Please,help me to fix this!

import UIKit

class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource{
    @IBOutlet var tabbleview1: UITableView!
    var Array1:[String]=[]
    override func viewDidLoad() {
        super.viewDidLoad()
        Array1 = ["iPhone", "iPad", "iPodTouh"]
        table1.delegate = self
        Table1.dataSource = self
    }
    func numberOfSections(in tableView: UITableView) -> Int {
        return 1
    }
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return Array1.count
    }
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "identiUier1", for: indexPath)
        cell.textLabel?.text = Array1[indexPath.row]
        cell.backgroundColor = .blue
        cell.accessoryType = .detailDisclosureButton
        return cell
    }
}

To fix error: Cannot find ‘table1’ in scope and error: Cannot find ‘Table1’ in scope

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img