0
我接收json
對象與此格式角色Anyobject到字典
"type":[{"id":"926"}]
我與Anyobject
型
@NSManaged var type: AnyObject?
結合它,我想將它轉換爲一個字典
if let t = type as? Dictionary<String, AnyObject> {
print(t["id"])
}
但鑄造劑量不成功,仍然總是沒有
[在迅速鑄造AnyObject到詞典]的可能的複製(https://stackoverflow.com/questions/24142541/casting-anyobject-to-dictionary-in-swift) –