[let appUrl = URL(string: "some link")!
let data = try Data(contentsOf: appUrl)
let json2 = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as! [String : AnyObject]
let post = json2["posts"] as? [[String:AnyObject]]
// here I want to connect to image but its still tell me the problem
//type '[[String : AnyObject]]' has no subscript members
let image = post["image"] as [[String:AnyObject]]
print(image)
Typ '[[String: ANYOBJECT]]' hat keine Index Mitglieder
Wie ist die tatsächliche Struktur Ihres JSON? Sie haben 'post' als ein Wörterbucharray deklariert, aber dann versuchen Sie, 'post' als Wörterbuch in der nächsten Zeile zu behandeln. – rmaddy
wie kann ich es tun? –
Können Sie eine Beispielstruktur Ihres JSONs veröffentlichen? –