【发布时间】:2017-03-21 04:36:06
【问题描述】:
我想将来自所有 ChildDBYAutoID 的每个图形项接收到一个双精度数组中。
-
另外,有没有更好的方法通过计数来做到这一点,所以没有自动 ID?比如例子:
0 724 1 744 2 745 3 800 . . .
我的主要目标是上传许多图表值,而不仅仅是更新一个。然后将图形值检索到一个双精度数组中。
func uploadToFirebase(){
//Firebase Initialization
var ref: FIRDatabaseReference!
ref = FIRDatabase.database().reference()
ref.child("general_room_index").childByAutoId().setValue(["graph_value": totalCountY])
}
databaseRef.child("general_room_index").observeSingleEventOfType(.Value, withBlock: { (snapshot) in
snapshot.value!["medals"] as! [Double]
})
【问题讨论】:
-
用你的数组试试
enumerate。 -
所以基本上你想在你的firebase
general_room_index节点中存储一个[Int:Int]字典并以相同的方式检索??
标签: ios swift firebase swift3 firebase-realtime-database