Value of type 'UITableViewCell' has no member 'postImageView'

后端 未结 3 1030
余生分开走
余生分开走 2021-01-25 22:26

New to iOS programming, I am getting the following error, I get it for 3 separate items, but solving one will solve them all.

I am getting the following error

Va

3条回答
  •  感动是毒
    2021-01-25 23:09

    tableView.dequeueReusableCell returns a UITableViewCell which (as the compiler tells you) does not have the properties you are asking for. You will have to cast it to the expected type NewsTableViewCell:

    let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! NewsTableViewCell

提交回复
热议问题