无法输入类型的值NSNull' (0x110a22770)到' NSString'

时间:2018-01-02 00:35:51

标签: swift

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错误:e​​mail = child.childSnapshot(forPath:" email")。value as!在使用firebase作为后端的情况下,给出任何关于可能导致这种情况的提示。

0 个答案:

没有答案