我收到了这个错误,但我正试图从中得到String一个Dictionary.这是我的代码:
FIRDatabase.database().reference().child("users").child(uid).observeEventType(.ChildAdded, withBlock: { (snapshot) in
let dictionary = snapshot.value as! NSDictionary
if let username = dictionary["name"] as? String {
cell.name.text = username
}
if let userlogin = dictionary["login"] as? String {
cell.login.text = userlogin
}
})
Run Code Online (Sandbox Code Playgroud)
在我的Firebase数据库中, "name"和"login"都是字符串.我无法理解这是什么问题.
任何帮助将不胜感激!