gpt4 book ai didi

Swift 和 Firebase 3.x 保存和检索数据

转载 作者:行者123 更新时间:2023-11-30 13:18:28 25 4
gpt4 key购买 nike

我使用以下代码将数据保存在一个 View 中:

let item1:String = textfield.text!

if TextField1.text != "" {
self.ref.child("userProfile").child((user!.uid)/value1Total").setValue(Double(item1)!)
}

在不同 View 中将保存的值设置为标签的代码是什么?

最佳答案

您可以尝试像下面的例子:

let name = nameTextField.text

let user: NSDictionary = ["name":name!,"dob":dateOfBirthTimeInterval]

//add firebase child node
let profile = firebase.ref.childByAppendingPath(name!)

// Write data to Firebase
profile.setValue(user)

看看这个 link欲了解更多信息

关于Swift 和 Firebase 3.x 保存和检索数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38004955/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com