【发布时间】:2018-12-29 20:04:36
【问题描述】:
我正在从 firebase 传递一个字符串格式的 URL 以加载图像,该 url 可以正常传递,但 cell.articleImage.sd_setImage(with: url, placeholderImage: UiImage(named: "issaimage")) 没有返回来自url的图片,只是占位符图片
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "articleCell") as? articlesCell else {
return UITableViewCell()}
let article = articleArray[indexPath.row]
let url = URL(string: article.imageURL)!
cell.articleImage.sd_setImage(with: url, placeholderImage: UIImage(named: "issaimage"))
cell.configureCell(title: article.ArticleTitle, author: article.author, date: article.date)
return cell
}
【问题讨论】:
-
“在我的 cell.configureCell(title: article.ArticleTitle, author: article.author, date: article.date, image: image) 函数中使用未解析的标识符‘image’”
-
显示那部分代码