Swift Dynamic Cast Failed on NSJSONSerialization
问题 I have a JSON Data which looks like: [ { "Name" : "Ernst Handel", "City" : "Graz", "Country" : "Austria" }, { "Name" : "Wolski Zajazd", "City" : "Warszawa", "Country" : "Poland" } ] and I am converting it to NSDictionary using: var jsonResult: NSDictionary = NSJSONSerialization.JSONObjectWithData( data, options: NSJSONReadingOptions.MutableContainers, error: nil) as NSDictionary 回答1: I usually use this. Works for both numeric and associative types of JSON. It works for your as well. I tried.