【发布时间】:2016-08-28 08:35:01
【问题描述】:
我正在尝试将 Firebase childrenCount 作为 string 转换为 tableview label。它打印了所有内容,但由于某种原因它没有将它们放入标签中。
我做错了什么,你能说吗?
我使用snapshot.childrenCount 在cellForRowAtIndexPath 内部实现这一点:
let ref = FIRDatabase.database().reference().child("Snuses").queryOrderedByChild("Brand").queryEqualToValue(brands[indexPath.row])
print(snapshot.childrenCount)
snusProductCountLabel.text = snapshot.childrenCount as? String
}
}
})
这是我滚动时控制台的输出:
7
3
8
3
26
5
5
1
8
3
10
【问题讨论】:
-
给出包含此节点的 JSON 树
Snuses.. -
@Dravidian 检查我的编辑。
标签: swift uitableview firebase firebase-realtime-database