func addUserObserver(_ update: @escaping () -> Void) {
FriendSystem.system.USER_REF.observe(DataEventType.value, with: { (snapshot) in
self.userList.removeAll()
for child in snapshot.children.allObjects as! [DataSnapshot] {
let email = child.childSnapshot(forPath: "email").value as! String
if email != Auth.auth().currentUser?.email! {
self.userList.append(User(userEmail: email, userID: child.key))
}
}
update()
})
}
我在以下行中收到信号sigabbt错误:email = child.childSnapshot(forPath:" email")。value as!在使用firebase作为后端的情况下,给出任何关于可能导致这种情况的提示。