Array display

0

I'm having trouble running xcode because of the error below:

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    let cell: TableViewCell = tableView.dequeueReusableCell(withIdentifier: "cell") as! TableViewCell



    cell.CellTitle.text = TitleList[indexPath.row]
    cell.CellDescription.text = DescriptionList[indexPath.row]

    let imagename = UIImage(named: ImageList[indexPath.row])
    cell.CellImage.image = imagename

    return cell

}





class TableViewController: UITableViewController {

    let ImageList = ["Burj.jpg","Eiffel.jpg","Empire.jpg","Kingdomtower.jpg","Taipei.jpg"]

    let TitleList = ["Burj Khalifa","Eiffel Tower","Empire state Building", "Kingdomtower Tower","Taipei 101",]

    let DescriptionList = ["Dubai, UAA","Paris, France","New Youk, USA", "Jeddai, Sauid Arabia","Taipei Taiwan",]



    override func viewDidLoad() {
        super.viewDidLoad()

         }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    // MARK: - Table view data source

    override func numberOfSections(in tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 1
    }

    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return TitleList.count
    }


    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

        let cell: TableViewCell = tableView.dequeueReusableCell(withIdentifier: "cell") as! TableViewCell



        cell.CellTitle.text = TitleList[indexPath.row]
        cell.CellDescription.text = DescriptionList[indexPath.row]

        let imagename = UIImage(named: ImageList[indexPath.row])
        cell.CellImage.image = imagename

        return cell

    }

    
asked by anonymous 27.10.2016 / 15:44

1 answer

1

You need to set the identifier of the TableViewCell in the storyboard.

    
11.10.2018 / 20:48