gpt4 book ai didi

swift - 如何将文本字段添加到新根下的firebase?

转载 作者:行者123 更新时间:2023-11-30 10:33:05 25 4
gpt4 key购买 nike

enter image description here

此方法不适用于我,我该怎么做才能将“reminderTextField”添加到新根下的 firebase 中?

最佳答案

该代码对我有用,尽管我们不知道 ref 是什么或 RememberTextField 是如何定义的。当我运行代码的 firebase 部分时,这就是我得到的

reminders
Reminder
Title
some_auto_id
date: "the date string"
message: "some message"
username: "Shaden"

话虽这么说,如果reminderTextField 是一个UI 元素,则无法存储它。您必须从 textField 获取文本字符串,然后将其存储

let reminderTextString = reminderTextField.text

然后是更新的代码

let parameters1 = ["username": "Shaden", "message": reminderTextString, "date": dateString]
ref.child("Reminder").child("Title").childByAutoId().setValue(parameters1)

关于swift - 如何将文本字段添加到新根下的firebase?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58672930/

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