【发布时间】:2016-11-12 00:08:15
【问题描述】:
我正在尝试运行以序列化 JSON 响应,但在“let json = ...”行出现错误。错误是“对成员 'jsonObject(with:options:)' 的不明确引用”。如果有人知道如何解决这个问题,我会欣赏它
Alamofire.request("https://httpbin.org/get").responseJSON { response in
if let JSON = response.result.value {
do {
let json = try JSONSerialization.jsonObject(with: response.result.value!, options: .allowFragments)
} catch {
print ()
}
print("JSON: \(JSON)")
}
}
【问题讨论】: