从firebase获取数据时崩溃

时间:2019-05-27 15:04:27

标签: ios swift uitableview

无法从Firebase检索数据,应用程序崩溃。 我尝试了很多选择,没有找到问题的根源

错误

  2019-05-27 17:58:15.999903+0300 contacts[13027:201893] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<contacts.Users 0x60000233f950> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Name.'

我的代码

Database.database().reference().child("users").observe(.childAdded, with: {
        (snapshot) in

        if let dictionary = snapshot.valueas? [String: AnyObject] {

            let userr = Users()

            userr.setValuesForKeys(dictionary)

           self.users.append(userr)

          print(self.users)

          DispatchQueue.main.async {

                self.TableInfo.reloadData()
            }
        }
}, withCancel: nil)

my firebase

class

0 个答案:

没有答案