【发布时间】:2016-11-11 11:03:25
【问题描述】:
我正在尝试从firebase 打印array。实际上,如果我们点击列表中的药物(tableviewcontroller),它会显示其特定剂量。我被困在检索剂量清单上。这是我从 firebase 获取数据的代码。任何帮助表示赞赏。提前致谢。我的 firebase 结构看起来像这样.. firebase img
func loadDataFromFirebase() {
databaseRef = FIRDatabase.database().reference().child("medication")
databaseRef.observeEventType(.Value, withBlock: { snapshot in
for item in snapshot.children{
FIRDatabase.database().reference().child("medication").child("options").observeEventType(.Value, withBlock: {snapshot in
print(snapshot.value)
})
}
})
【问题讨论】: