我試着使用for child in snapShot.children
我知道當時我曾經是能夠使它發揮作用創造一個火力點childSnapshot
,林不知道這是否是在新的更新如何檢索Firebase中的子快照?
是用來工作
-old方式的變革for child in snapshot.children {
let firUserId = child.childSnapshot(forPath: "userId").value! as! String
let receivePostSnapshot = child.childSnapshot(forPath: "receivePost")
}
我當前的代碼不工作
func displayAvailaibleHelprOnMap(){
let refUrl = "frontEnd/users"
let childRef = Ref.childRef(refUrl: refUrl)//.child("users")
childRef.observe(.value, with: {snapshot in
let dict = snapshot.value as? NSDictionary
for child in snapshot.children{
// I want to use child snapshot here
//let childDict = child.childSnapshot(forPath: "receivePost")
}
}
如果*我當前的代碼不工作*,到底是你的問題或錯誤? – Dravidian
@Dravidian它應該說不行 – pprevalon