【发布时间】:2016-09-16 02:59:23
【问题描述】:
iOS 编程新手,我收到以下错误,我得到了 3 个单独的项目,但解决一个将解决所有问题。
我收到以下错误
“UITableViewCell”类型的值没有成员“postImageView”
// return how may records in a table
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.rssRecordList.count
}
// return cell
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> NewsTableViewCell {
// collect reusable cell
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
// find record for current cell
let thisRecord : RssRecord = self.rssRecordList[(indexPath as NSIndexPath).row]
// set value for main title and detail tect
cell.postImageView.image = UIImage(thisRecord.image)
cell.postTitleLabel.text = thisRecord.title
cell.authorLabel.text = thisRecord.storyDate
// return cell
return cell as! NewsTableViewCell
}
【问题讨论】:
标签: ios swift uitableview