【发布时间】:2017-01-14 05:09:28
【问题描述】:
我正在努力将图像从 Firebase 存储检索到我的 TableView。感谢任何帮助。以下是我的代码:
tableviewcell 代码:
class HomeFeedCell : UITableViewCell {
Var feeds = [HomeFeed]()
var dbRef :FIRDatabaseReference!
var storage : FIRStorage!
@IBOutlet weak var Name: UILabel!
@IBOutlet weak var Location: UILabel!
@IBOutlet weak var Type: UILabel!
@IBOutlet weak var FeedImage: UIImageView!
func configureCellWith(product : HomeFeed)
{
Name.text? = product.name
Location.text? = product.location
Type.text? = product.type
func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
// Configure the view for the selected state
}
}
我的表格视图:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell1", forIndexPath: indexPath) as! HomeFeedCell
let details = feeds[indexPath.row]
cell.configureCellWith(details)
return cell
}
我能够成功显示名称、位置和类型详细信息,但我只是卡在检索图像上。下面是我的结构文件:
struct HomeFeed {
let key:String!
let name:String!
let location:String!
let review:String!
let type:String!
let photoURL:String
【问题讨论】:
标签: ios uitableview firebase firebase-storage