Im trying to get data from a dictionary and appending it in a array (I followed this Tutorial).
This how the dictionary Looks like:
["Name": TEST, "ID": 51C3EE09-5718-4E07-9C88-FC2409BA6AC1, "Name_O": test, "Users": ]
but unfortunatly it fails to get the data
refHandle = ref.child("Pages").observe(.childAdded , with: { (snapshot) in
if let dictionary = snapshot.value as? [String: AnyObject] {
print(dictionary)
let data = Data()
data.setValuesForKeys(dictionary) //Error Happens Here "Thread Breakpoint"
self.dataList.append(data)
self.tableView.reloadData()
}
})
If I remove the line where the error was the array would look something like this:
[<app.Data: 0x786f4830>, <app.Data: 0x786f4ef0>]
Which confuses me...
instead of typing setValuesForKeys
appenrently it supposed to be written setValuesForKeysWithDictionary
(in Tutorial) but does not work anymore.
Thanks in advance for helping!