启动我的应用程序时,出现红色错误:线程1:信号SIGABRT ,并且在分析中说:无法将类型'NSTaggedPointerString'(0x10dc70598)的值强制转换为'NSDictionary'( 0x10dc708b8)。 代码:
func fetchDataFromServer(callback: @escaping (Room) -> ()) {
DataService.dataService.ROOM_REF.observe(.childAdded) { (snapshot) in
print("FOUND ROOM "+snapshot.key)
let room = Room(key: snapshot.key, snapshot: snapshot.value as! Dictionary<String, AnyObject>)
callback(room)
}
一些JSON:
{
"rooms" : {
"-LRjiSQjXY4OkfQLRpCZ" : {
"caption" : "Potatis",
"thumbnailUrlFromStorage" : "gs://ilapp- a1429.appspot.com/KLabp9zlfgZZ78dPQ9Eysrc9C6r2/564386764"
},