作者:唯爱WE创丶 | 来源:互联网 | 2023-05-18 05:21
InFirebase2.5.1,thiswasworking:在Firebase2.5.1中,这是有效的:letpost1RefsendRequestRef.childByA
In Firebase 2.5.1, this was working:
在Firebase 2.5.1中,这是有效的:
let post1Ref = sendRequestRef.childByAutoId()
post1Ref.setValue(request, withCompletionBlock: {( error:NSError?, ref:Firebase!) in
})
However, I couldn't figure out how to achieve it in 3.x (as the docs for completion doesn't really tell it)
但是,我无法弄清楚如何在3.x中实现它(因为完成的文档并没有真正告诉它)
let post1Ref = sendRequestRef.childByAutoId()
post1Ref.setValue(request, withCompletionBlock: {( error:NSError?, ref:Firebase!) in
if (error != nil) {
print("ERROR")
} else {
print("Success")
}
})
This throws an error:
这会引发错误:
Use of unresolved Firebase
使用未解决的Firebase
What is the proper way of handling completion block with Firebase 3.x?
使用Firebase 3.x处理完成块的正确方法是什么?
1 个解决方案