草庐IT

childByAppendingPath

全部标签

ios - 如何在 firebase (swift) 中获取子节点的值,并将其显示在 View Controller 的标签中

这是我的Firebase结构用户:简单登录1:姓名:迈克年龄:24地点:美国我正在尝试获取当前登录用户的信息并将其显示在ViewController中的标签上。我在加载的View中编写了以下代码:overridefuncviewDidLoad(){super.viewDidLoad()ref.observeSingleEventOfType(.ChildAdded,withBlock:{snapshotinprintln(snapshot.value["users\(self.ref.authData.uid)/age"]as?String)})但是当我运行我的应用程序时,它会在控制台

ios - 使用未声明的类型 'Firebase'

我知道这是最常被问到的问题之一,但仍然找不到问题所在。我尝试更新pod,但仍然出现此错误。importFirebasepublicstaticfunccreateUrlToGetMessages(threadIdid:String)->Firebase{returnFirebase(url:FIREBASE_BASE_REF).childByAppendingPath("chats").childByAppendingPath(id).childByAppendingPath("messages")}publicstaticfunccreateUrlToGetOneMessageRef